X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Ffilter-functions.php;h=d76cad43ed1d8bc42b7c02d03ebe2e276f5311fb;hb=b5cc7a564aee39e995b64c3db502b02ef20379bd;hp=792e335c611be244e6deb3ed2b493482115c39f6;hpb=c8a83fa31256474eccf50db85187ee6a83d67e26;p=mailer.git diff --git a/inc/filter-functions.php b/inc/filter-functions.php index 792e335c61..d76cad43ed 100644 --- a/inc/filter-functions.php +++ b/inc/filter-functions.php @@ -44,9 +44,9 @@ if (!defined('__SECURITY')) { // Init "generic filter system" function initFilterSystem () { // Is the filter already initialized? - if (isset($GLOBALS['filters'])) { + if (isset($GLOBALS['filter_init'])) { // Then abort here - debug_report_bug(getMessage('FILTER_FAILED_ALREADY_INIT')); + debug_report_bug('Filter system already initialized.'); } // END - if // Load all saved filers if sql_patches is updated @@ -69,6 +69,9 @@ function initFilterSystem () { $filterArray['chains'][$filterName][$filterFunction] = $GLOBALS['cache_array']['filter']['filter_active'][$idx]; } // END - foreach + // Mark it as initialized + $GLOBALS['filter_init'] = true; + // Remove the cache $GLOBALS['cache_array']['filter'] = $filterArray; } elseif ((!isInstallationPhase()) && (isExtensionInstalledAndNewer('sql_patches', '0.5.9'))) { @@ -120,6 +123,7 @@ ORDER BY registerFilter('init', 'CHECK_SVN_REVISION'); registerFilter('init', 'RUN_DAILY_RESET'); registerFilter('init', 'INIT_RANDOMIZER'); + registerFilter('init', 'INIT_RANDOM_NUMBER'); registerFilter('init', 'TRIGGER_SENDING_POOL'); registerFilter('init', 'DETERMINE_USERNAME'); registerFilter('init', 'DETERMINE_WHAT_ACTION'); @@ -181,7 +185,8 @@ function registerFilter ($filterName, $filterFunction, $silentAbort = true, $for if ((isset($GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction])) && ($force === false)) { // Then abort here if ($silentAbort === false) { - addFatalMessage(__FUNCTION__, __LINE__, getMessage('FILTER_FAILED_ALREADY_ADDED'), array($filterFunction, $filterName)); + // Add fatal message + addFatalMessage(__FUNCTION__, __LINE__, sprintf("Filter chain %s has already filter function %s registered!", $filterName, $filterFunction)); } // END - if // Abort here @@ -193,7 +198,7 @@ function registerFilter ($filterName, $filterFunction, $silentAbort = true, $for // Is the function there? if (!function_exists($filterFunction)) { // Then abort here - addFatalMessage(__FUNCTION__, __LINE__, sprintf(getMessage('FILTER_FAILED_404'), $filterFunction, $filterName)); + addFatalMessage(__FUNCTION__, __LINE__, sprintf("Filter function %s could not be added to filter chain %s.", $filterFunction, $filterName)); return false; } // END - if