X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Ffilter-functions.php;h=7c88b79ca9e814abb561b2946335c165349e1ada;hb=dde77b05dc5a7a7d6e2d0c9241c3048052d477eb;hp=792e335c611be244e6deb3ed2b493482115c39f6;hpb=2057e5615107b04186010bb02fd669a51e0da17a;p=mailer.git diff --git a/inc/filter-functions.php b/inc/filter-functions.php index 792e335c61..7c88b79ca9 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,9 +123,11 @@ 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'); + registerFilter('init', 'COUNT_MODULE'); registerFilter('init', 'UPDATE_LOGIN_DATA'); registerFilter('init', 'ACTIVATE_EXCHANGE'); @@ -170,6 +175,14 @@ ORDER BY // Exclude some users registerFilter('exclude_users', 'HTML_INCLUDE_USERS'); + + // Handling of fatal errors + registerFilter('handle_fatal_errors', 'HANDLE_FATAL_ERRORS'); + + // Page footer filters + registerFilter('page_footer', 'HANDLE_FATAL_ERRORS'); + registerFilter('page_footer', 'DISPLAY_COPYRIGHT'); + registerFilter('page_footer', 'DISPLAY_PARSING_TIME'); } // "Registers" a new filter function @@ -181,7 +194,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 +207,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