From 3a9723e159b1d9621c8a62927c9b911d6b484286 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 19 Dec 2008 17:25:03 +0000 Subject: [PATCH] Fixes for filter 'load_includes' --- inc/autopurge.php | 2 +- inc/check-reset.php | 2 +- inc/databases.php | 2 +- inc/extensions.php | 2 +- inc/filters.php | 13 +++++-------- inc/load_cache.php | 2 +- inc/load_extensions.php | 2 +- inc/pool-update.php | 2 +- 8 files changed, 12 insertions(+), 15 deletions(-) diff --git a/inc/autopurge.php b/inc/autopurge.php index c3a206f0fb..75bddcd86b 100644 --- a/inc/autopurge.php +++ b/inc/autopurge.php @@ -41,7 +41,7 @@ if (!defined('__SECURITY')) { $INC_POOL = GET_DIR_AS_ARRAY(PATH."inc/autopurge/", "purge-"); // Run the filter -RUN_FILTER('load_includes'); +RUN_FILTER('load_includes', $INC_POOL); // Run filters for extra autopurge RUN_FILTER('extra_autopurge'); diff --git a/inc/check-reset.php b/inc/check-reset.php index cf6c67c6aa..88335c12cc 100644 --- a/inc/check-reset.php +++ b/inc/check-reset.php @@ -47,7 +47,7 @@ if ((date("d", getConfig('last_update')) != date("d", time())) && ((!defined('mx $INC_POOL = RESET_ADD_INCLUDES(); // Run the filter - RUN_FILTER('load_includes'); + RUN_FILTER('load_includes', $INC_POOL); } // END - if // diff --git a/inc/databases.php b/inc/databases.php index 7c50726c61..3bb3fe226e 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -115,7 +115,7 @@ define('USAGE_BASE', "usage"); define('SERVER_URL', "http://www.mxchange.org"); // Current SVN revision -define('CURR_SVN_REVISION', "669"); +define('CURR_SVN_REVISION', "670"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/extensions.php b/inc/extensions.php index ccd38d91f2..f2fd57bcce 100644 --- a/inc/extensions.php +++ b/inc/extensions.php @@ -486,7 +486,7 @@ function EXTENSION_UPDATE ($ext_name, $ext_ver, $dry_run = false) { // In real-mode execute any existing includes if (!$dry_run) { $cacheArray['inc_pool'][$ext_name] = $INC_POOL; - RUN_FILTER('load_includes'); + RUN_FILTER('load_includes', $INC_POOL); $INC_POOL = $cacheArray['inc_pool'][$ext_name]; unset($cacheArray['inc_pool'][$ext_name]); } // END - if diff --git a/inc/filters.php b/inc/filters.php index d582202ac6..82f9dcb27a 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -387,14 +387,14 @@ function FILTER_SOLVE_TASK ($data) { } // Filter to load include files -function FILTER_LOAD_INCLUDES ($data) { - global $INC_POOL, $CSS; +function FILTER_LOAD_INCLUDES ($INC_POOL) { + global $CSS; // Is it an array? if ((!isset($INC_POOL)) || (!is_array($INC_POOL))) { // Then abort here DEBUG_LOG(__FILE__, __LINE__, "INC_POOL is no array!"); - return $data; + return; } // END - if // Check for added include files @@ -404,12 +404,9 @@ function FILTER_LOAD_INCLUDES ($data) { require_once($fqfn); } // END - foreach - // Remove array - unset($INC_POOL); + // Reset array + $INC_POOL = array(); } // END - if - - // Return $data - return $data; } // Filter for running SQL commands diff --git a/inc/load_cache.php b/inc/load_cache.php index 3039a408d1..4e849ba440 100644 --- a/inc/load_cache.php +++ b/inc/load_cache.php @@ -41,7 +41,7 @@ if (!defined('__SECURITY')) { $INC_POOL = GET_DIR_AS_ARRAY(PATH."inc/loader/", "load_cache-"); // Run the filter -RUN_FILTER('load_includes'); +RUN_FILTER('load_includes', $INC_POOL); // ?> diff --git a/inc/load_extensions.php b/inc/load_extensions.php index 7ec8ecc44f..fae66b3b56 100644 --- a/inc/load_extensions.php +++ b/inc/load_extensions.php @@ -263,7 +263,7 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && ((($cacheMode == "init") && ($CSS != "1") } // END - if // Run the filter -RUN_FILTER('load_includes'); +RUN_FILTER('load_includes', $INC_POOL); // Uninstall extensions that are no longer in our system if (!empty($DEL[0])) { diff --git a/inc/pool-update.php b/inc/pool-update.php index b2fd7c8ca8..32256682f5 100644 --- a/inc/pool-update.php +++ b/inc/pool-update.php @@ -50,7 +50,7 @@ $GLOBALS['pool_cnt'] = 0; $INC_POOL = GET_DIR_AS_ARRAY(PATH."inc/pool/", "pool-"); // Run the filter -RUN_FILTER('load_includes'); +RUN_FILTER('load_includes', $INC_POOL); // Remove counter again unset($GLOBALS['pool_cnt']); -- 2.39.5