Caching again rewritten, admin functions fixed:
[mailer.git] / inc / filter-functions.php
index 792e335c611be244e6deb3ed2b493482115c39f6..e65b789167c411a17bd3fc2165084f7eda160ac6 100644 (file)
@@ -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