X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Ffilter-functions.php;h=dc97d8ec41393402a6c01c6688394ea1b9273ef4;hp=4e19d0980aa78d2ba0a3b655a6eb8f27897c585d;hb=ba59d6cfbe27195f59bbe2b7cab3d01bf9ceb566;hpb=87342ad9d6400e1a819d6179696da412acb7c6e7 diff --git a/inc/filter-functions.php b/inc/filter-functions.php index 4e19d0980a..dc97d8ec41 100644 --- a/inc/filter-functions.php +++ b/inc/filter-functions.php @@ -311,8 +311,8 @@ function runFilterChain ($filterName, $filterData = NULL) { //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'filterName=' . $filterName . ',count()=' . count($GLOBALS['cache_array']['filter']['chains'][$filterName])); $returnValue = $filterData; - // Remove any existing flag(s) - unset($GLOBALS['filter_chain_aborted']); + // Continue filter chain is default + continueFilterChain(); // Then run all filters foreach ($GLOBALS['cache_array']['filter']['chains'][$filterName] as $filterFunction => $active) { @@ -431,7 +431,19 @@ function loadExtensionFilters ($ext_name) { // Checks whether the filter chain has been aborted function isFilterChainAborted () { // Determine it - return ((isset($GLOBALS['filter_chain_aborted'])) && ($GLOBALS['filter_chain_aborted'] === TRUE)); + return ((isset($GLOBALS['filter_chain_interrupted'])) && ($GLOBALS['filter_chain_interrupted'] === TRUE)); +} + +// Interrupts the filter chain by enabling flag 'filter_chain_aborted' +function interruptFilterChain () { + // Set it + $GLOBALS['filter_chain_interrupted'] = TRUE; +} + +// Continues the filter chain by disabling flag 'filter_chain_aborted' +function continueFilterChain () { + // Set it + $GLOBALS['filter_chain_interrupted'] = FALSE; } // [EOF]