X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Ffilter-functions.php;h=dca5b9ec6cff5fa9a013f1e610180f905c8194ce;hp=792e335c611be244e6deb3ed2b493482115c39f6;hb=97cc48768dde69e5a98aab29b54ae7326422f9cb;hpb=c8a83fa31256474eccf50db85187ee6a83d67e26 diff --git a/inc/filter-functions.php b/inc/filter-functions.php index 792e335c61..dca5b9ec6c 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'))) { @@ -181,7 +184,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 +197,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