]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/autopurge_functions.php
Fixes for running SQL queries
[mailer.git] / inc / libs / autopurge_functions.php
index 62073918fc055ad5ebe1ed11fe9e4295fe343428..249a4e70cbd7926aa30a81dab63698bf6f110122 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,7 +41,7 @@ function AUTOPURGE_ADD_POINTS($uid, $points)
 {
        global $jackpot;
        // Check if he has locked points or not
-       $result = SQL_QUERY_ESC("SELECT ref_payout FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT ref_payout FROM `"._MYSQL_PREFIX."_user_data` WHERE userid=%s LIMIT 1",
         array(bigintval($uid)), __FILE__, __LINE__);
        list($payout) = SQL_FETCHROW($result);
        SQL_FREERESULT($result);
@@ -61,7 +60,7 @@ function AUTOPURGE_ADD_POINTS($uid, $points)
        {
                // ... to jackpot account
                ADD_JACKPOT($points);
-               if (empty($jackpot)) $jackpot = "0";
+               if (empty($jackpot)) $jackpot = 0;
                $jackpot += $points;
        }
         else