X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Ffilters.php;h=1355975dd7c81e50fe950f1a26226e73cb33d343;hp=0fc19fa5527b4408f9d42d6e94074e5c2b0c11ce;hb=5b498995f1792ba5972d782b63cd5cb044727c21;hpb=323f6a7c78424b654b62b69eeb44995908a5327e diff --git a/inc/filters.php b/inc/filters.php index 0fc19fa552..1355975dd7 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -319,7 +319,7 @@ function FILTER_FLUSH_FILTERS () { } // END - if // Run the run_sqls filter in non-dry mode - RUN_FILTER('run_sqls', false); + RUN_FILTER('run_sqls', array('dry_run' => false, 'sqls' => $SQLs)); } // Filter for calling the handler for login failtures @@ -419,13 +419,11 @@ function FILTER_LOAD_INCLUDES ($data) { } // Filter for running SQL commands -function FILTER_RUN_SQLS ($dry_run) { - global $SQLs; - +function FILTER_RUN_SQLS ($data) { // Is the array there? - if ((is_array($SQLs)) && (!$dry_run)) { + if ((isset($data['sqls'])) && ((!isset($data['dry_run'])) || ($data['dry_run'] == false))) { // Run SQL commands - foreach ($SQLs as $sql) { + foreach ($data['sqls'] as $sql) { $sql = trim($sql); if (!empty($sql)) { // Do we have an "ALTER TABLE" command? @@ -438,10 +436,7 @@ function FILTER_RUN_SQLS ($dry_run) { } } // END - if } // END - foreach - } elseif (GET_EXT_VERSION("sql_patches") == "") { - // Remove SQLs if extension is not installed - $SQLs = array(); - } + } // END - if } // Filter for updating/validating login data