X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Ffilter-functions.php;h=ce4d30276ed5cd0a489b22483ba7da8fde0d818a;hp=b8f8313e2fe270a3bed075db379f34d54614cf7b;hb=f1308369312b448023e572dc12dec0da6a9b5e52;hpb=64c8349613addc3da2242c5cd6b99d64e3fb5f8e diff --git a/inc/filter-functions.php b/inc/filter-functions.php index b8f8313e2f..ce4d30276e 100644 --- a/inc/filter-functions.php +++ b/inc/filter-functions.php @@ -49,15 +49,15 @@ function initFilterSystem () { debug_report_bug(getMessage('FILTER_FAILED_ALREADY_INIT')); } // END - if - // Init dummy array - $filterArray = array( - 'chains' => array(), - 'loaded' => array(), - 'counter' => array() - ); - // Load all saved filers if sql_patches is updated if (isset($GLOBALS['cache_array']['filter']['filter_name'])) { + // Init dummy array + $filterArray = array( + 'chains' => array(), + 'loaded' => array(), + 'counter' => array() + ); + // Found in cache so rewrite the array foreach ($GLOBALS['cache_array']['filter']['filter_name'] as $idx => $filterName) { // Get filter function @@ -74,7 +74,7 @@ function initFilterSystem () { // Remove the cache $GLOBALS['cache_array']['filter'] = $filterArray; - } elseif (isExtensionInstalledAndNewer('sql_patches', '0.5.9')) { + } elseif ((!isInstallationPhase()) && (isExtensionInstalledAndNewer('sql_patches', '0.5.9'))) { // Init add $add = ''; if (getExtensionVersion('sql_patches') >= '0.6.0') $add = ", `filter_counter`"; @@ -201,7 +201,7 @@ function registerFilter ($filterName, $filterFunction, $silentAbort = true, $for } // END - if // Simply add it to the array - //* DEBUG: */ print 'filterName='.$filterName.',filterFunction='.$filterFunction.'
'; + //* DEBUG: */ print __FUNCTION__.': filterName='.$filterName.',filterFunction='.$filterFunction.'
'; $GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction] = 'A'; $GLOBALS['cache_array']['filter']['counter'][$filterName][$filterFunction] = 0; } // END - if @@ -224,6 +224,7 @@ function unregisterFilter ($filterName, $filterFunction, $force = false, $dry_ru // Shall we remove? (default, not while just showing an extension removal) if ($dry_run === false) { // Mark for filter removal + //* DEBUG: */ print __FUNCTION__.': filterName='.$filterName.',filterFunction='.$filterFunction.'
'; $GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction] = 'R'; } // END - if } @@ -233,10 +234,10 @@ function runFilterChain ($filterName, $data = null) { // Is that filter chain there? if (!isset($GLOBALS['cache_array']['filter']['chains'][$filterName])) { // We should find all these non-existing filter chains - if ($filterName != 'sql_admin_extra_data') { - /* Only for tracking: */ debug_report_bug('Filter chain ' . $filterName . ' not found!'); - } - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Filter chain ' . $filterName . ' not found!'); + //* Only for tracking: */ if ($filterName != 'sql_admin_extra_data') { + //* Only for tracking: */ debug_report_bug('Filter chain ' . $filterName . ' not found!'); + //* Only for tracking: */ } + /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Filter chain ' . $filterName . ' not found!'); // Abort here and return content return $data;