Renamed function so it might be more understandable
[mailer.git] / inc / filters.php
index c15b92abab30287b2a99651b7c552de38b3f0d4d..0b07e67b7eec01c714a4e8d4944ab105e3c5f55b 100644 (file)
@@ -109,10 +109,10 @@ function FILTER_FLUSH_FILTERS () {
                // Update all counters
                foreach ($GLOBALS['cache_array']['filter']['counter'] as $filterName => $filterArray) {
                        // Walk through all filters
-                       foreach ($filterArray as $filterFunction => $cnt) {
+                       foreach ($filterArray as $filterFunction => $count) {
                                // Construct and add the query
                                addSql(sprintf("UPDATE `{?_MYSQL_PREFIX?}_filters` SET `filter_counter`=%s WHERE `filter_name`='%s' AND `filter_function`='%s' LIMIT 1",
-                                       bigintval($cnt),
+                                       bigintval($count),
                                        $filterName,
                                        $filterFunction
                                ));
@@ -330,7 +330,7 @@ function FILTER_INIT_RANDOMIZER () {
        setConfigEntry('_PRIME', 591623);
 
        // Calculate "entropy" with the prime number (for code generation)
-       setConfigEntry('_ADD', (getPrime() * getPrime() / (pi() * getConfig('code_length') + 1)));
+       setConfigEntry('_ADD', (getPrime() * getPrime() / (pi() * getCodeLength() + 1)));
 
        // Simply init the randomizer with seed and _ADD value
        mt_srand(generateSeed() + getConfig('_ADD'));
@@ -469,7 +469,7 @@ function FILTER_COMPILE_EXPRESSION_CODE ($code) {
                        $callback       = '';
                        $extraFunction  = '';
                        $extraFunction2 = '';
-                       $value          = '';
+                       $value          = null;
 
                        // Extract command and call-back
                        $cmdArray = explode(',', $cmd);
@@ -521,7 +521,7 @@ function FILTER_COMPILE_EXPRESSION_CODE ($code) {
                                $code = call_user_func($commandFunction, $data);
                        } else {
                                // Unsupported command detected
-                               logDebugMessage(__FUNCTION__, __LINE__, 'Command=' . $cmd . ', callback=' . $callback . ', extra=' . $extraFunction . ' is unsupported.');
+                               logDebugMessage(__FUNCTION__, __LINE__, 'Command cmd=' . $cmd . ', callback=' . $callback . ', extra=' . $extraFunction . ' is unsupported.');
                        }
                } // END - foreach
        } // END - if
@@ -580,7 +580,7 @@ function FILTER_RUN_RESET_INCLUDES () {
                $currMonth = getMonth();
 
                // Has it changed?
-               if ((getConfig('last_month') != $currMonth) || (isMonthlyResetDebugEnabled())) {
+               if ((getLastMonth() != $currMonth) || (isMonthlyResetDebugEnabled())) {
                        // Include monthly reset scripts
                        mergeIncludePool('reset', getArrayFromDirectory('inc/monthly/', 'monthly_'));
 
@@ -1020,7 +1020,7 @@ function FILTER_SET_CURRENT_DATE () {
        setConfigEntry('CURRENT_DATE', generateDateTime(time(), '3'));
 
        // Timestamp for yesterday, today ... all at 00:00 am
-       setConfigEntry('START_YDAY', makeTime(0, 0, 0, time() - getConfig('ONE_DAY')));
+       setConfigEntry('START_YDAY', makeTime(0, 0, 0, time() - getOneDay()));
        setConfigEntry('START_TDAY', makeTime(0, 0, 0, time()));
 }