Security line in all includes changed
[mailer.git] / inc / pool-update.php
index a6ef8e18ebd34d3fdce5458053649154966eae7f..20b406250295213b9e606b733a80e394f1e6508d 100644 (file)
  ************************************************************************/
 
 // 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);
 }
 
+// Don't run on daily reset
+if (defined('__DAILY_RESET')) {
+       // Skip here
+       return false;
+} // END - if
+
 // Test html extensions once
 $HTML_EXT = EXT_IS_ACTIVE("html_mail", true);
 
 // Check for freed mail orders to send out
-if ($HTML_EXT)
-{
+if ($HTML_EXT) {
        //                                0     1        2      3       4          5            6      7        8          9       10
        $result_main = SQL_QUERY("SELECT id, sender, subject, text, receivers, payment_id, timestamp, url, target_send, cat_id, html_msg FROM "._MYSQL_PREFIX."_pool WHERE data_type='NEW' ORDER BY timestamp DESC", __FILE__, __LINE__);
-}
- else
-{
+} else {
        //                                0     1        2      3       4          5            6      7        8          9    10
        $result_main = SQL_QUERY("SELECT id, sender, subject, text, receivers, payment_id, timestamp, url, target_send, cat_id, id FROM "._MYSQL_PREFIX."_pool WHERE data_type='NEW' ORDER BY timestamp DESC", __FILE__, __LINE__);
 }