// 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
$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'))) {
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