More fixes for cache, extension and filter sub-system
[mailer.git] / inc / filters.php
index b750c4a772aed5fe03084462a730e27ff7d63e42..939a15c6b6384892d57944f32280bb7d15e1f24d 100644 (file)
@@ -121,7 +121,7 @@ function REGISTER_FILTER ($filterName, $filterFunction, $silentAbort = true, $fo
 }
 
 // "Unregisters" a filter from the given chain
-function UNREGISTER_FILTER ($filterName, $filterFunction, $force = false) {
+function UNREGISTER_FILTER ($filterName, $filterFunction, $force = false, $remove = true) {
        global $filters;
 
        // Extend the filter function name
@@ -134,8 +134,11 @@ function UNREGISTER_FILTER ($filterName, $filterFunction, $force = false) {
                return false;
        } // END - if
 
-       // Mark for filter removal
-       $filters[$filterName][$filterFunction] = "R";
+       // Shall we remove? (default, not while just showing an extension removal)
+       if ($remove) {
+               // Mark for filter removal
+               $filters[$filterName][$filterFunction] = "R";
+       } // END  - if
 }
 
 // "Runs" the given filters, data is optional and can be any type of data
@@ -146,6 +149,7 @@ function RUN_FILTER ($filterName, $data = null, $silentAbort = true) {
        if (!isset($filters[$filterName])) {
                // Then abort here (quick'N'dirty hack)
                if ((!$silentAbort) && (defined('FILTER_FAILED_NO_FILTER_FOUND'))) {
+                       // Add fatal message
                        ADD_FATAL(sprintf(FILTER_FAILED_NO_FILTER_FOUND, $filterName));
                } // END - if