Fixes for extension removal, now directly sent to [UN]REGISTER_FILTER()
[mailer.git] / inc / filters.php
index 79f0ef4c6e31ae4925f166962a41b993abbce9df..fe843fb8f0a74f9ad1c1835985e69490ba1bea1d 100644 (file)
@@ -130,7 +130,7 @@ ORDER BY `filter_id` ASC", __FILE__, __LINE__);
 }
 
 // "Registers" a new filter function
-function REGISTER_FILTER ($filterName, $filterFunction, $silentAbort = true, $force = false, $add = true) {
+function REGISTER_FILTER ($filterName, $filterFunction, $silentAbort = true, $force = false, $dry_run = false) {
        global $filters, $counter;
 
        // Extend the filter function name
@@ -155,7 +155,7 @@ function REGISTER_FILTER ($filterName, $filterFunction, $silentAbort = true, $fo
        } // END - if
 
        // Shall we add it?
-       if ($add) {
+       if (!$dry_run) {
                // Simply add it to the array
                $filters[$filterName][$filterFunction] = "Y";
                $counter[$filterName][$filterFunction] = 0;
@@ -163,7 +163,7 @@ function REGISTER_FILTER ($filterName, $filterFunction, $silentAbort = true, $fo
 }
 
 // "Unregisters" a filter from the given chain
-function UNREGISTER_FILTER ($filterName, $filterFunction, $force = false, $remove = true) {
+function UNREGISTER_FILTER ($filterName, $filterFunction, $force = false, $dry_run = false) {
        global $filters, $counter, $loadedFilters;
 
        // Extend the filter function name only if not loaded from database
@@ -179,7 +179,7 @@ function UNREGISTER_FILTER ($filterName, $filterFunction, $force = false, $remov
        } // END - if
 
        // Shall we remove? (default, not while just showing an extension removal)
-       if ($remove) {
+       if (!$dry_run) {
                // Mark for filter removal
                $filters[$filterName][$filterFunction] = "R";
                unset($counter[$filterName][$filterFunction]);