Security line in all includes changed
[mailer.git] / inc / gen_mediadata.php
index 07d1e7a7e9d04d7cef752cdb137a9fbbb8c92fd4..66d5a4d8f0c2486726006840d2c89c014f2a79d7 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
@@ -42,8 +41,8 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
 $result_media = SQL_QUERY("SELECT SUM(max_rec) AS max_rec, SUM(clicks) AS clicks
 FROM "._MYSQL_PREFIX."_user_stats", __FILE__, __LINE__);
 list($nsent, $nclicks) = SQL_FETCHROW($result_media);
-if (empty($nsent))   $nsent   = "0";
-if (empty($nclicks)) $nclicks = "0";
+if (empty($nsent))   $nsent   = 0;
+if (empty($nclicks)) $nclicks = 0;
 
 // Free memory
 SQL_FREERESULT($result_media);
@@ -63,13 +62,13 @@ if (EXT_IS_ACTIVE("bonus"))
        $result_media = SQL_QUERY("SELECT SUM(mails_sent) AS bonus_sent, SUM(clicks) AS bonus_clicks
 FROM "._MYSQL_PREFIX."_bonus", __FILE__, __LINE__);
        list($bsent, $bclicks) = SQL_FETCHROW($result_media);
-       if (empty($bsent))   $bsent   = "0";
-       if (empty($bclicks)) $bclicks = "0";
+       if (empty($bsent))   $bsent   = 0;
+       if (empty($bclicks)) $bclicks = 0;
 }
  else
 {
        // Not found!
-       $bsent = "0"; $bclicks = "0";
+       $bsent = 0; $bclicks = 0;
 }
 
 // Load (maybe) missing file