X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fload_extensions.php;h=21fdf5ee5a905bfe0192c18f35b51ff3951be1e7;hb=04036a4a4742c06629a5acba7c6c6ad2b5a03c5a;hp=59bc1518a04751a11b39b165dc1a3bd5890d9b3f;hpb=80e2def8ef2125fd4d7d1312ee3993ab613f0846;p=mailer.git diff --git a/inc/load_extensions.php b/inc/load_extensions.php index 59bc1518a0..21fdf5ee5a 100644 --- a/inc/load_extensions.php +++ b/inc/load_extensions.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } @@ -80,14 +79,13 @@ if (EXT_IS_ACTIVE("cache")) { } if ($cacheMode == "load") { - // Load more cache files (like admins) - require_once(PATH."inc/load_cache.php"); - // Re-initialize handler $cacheInstance->cache_file("extensions", true); // Load extension data from cache file $EXT_DUMMY = $cacheInstance->cache_load(); + + // Begin with the cache preparation of extensions $EXT_NAMES = array(); foreach ($EXT_DUMMY['ext_name'] as $k => $name) { // Load functions file @@ -153,6 +151,9 @@ if ($cacheMode == "load") { // No database load needed $res_ext_crt = false; + + // Load more cache files (like admins) + require_once(PATH."inc/load_cache.php"); } else { // If current user is not admin load only activated extensions // The admin shall use every available extension for testing purposes @@ -291,12 +292,12 @@ if (!empty($DEL[0])) { // Remove extensions from two tables: extension registry and tasks table foreach ($DEL as $name) { // First remove entry from extensions table - $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_extensions WHERE ext_name='%s' LIMIT 1", - array($name), __FILE__, __LINE__); + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_extensions WHERE ext_name='%s' LIMIT 1", + array($name), __FILE__, __LINE__); // Remove (maybe?) found tasks (main task and possible updates - $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_task_system WHERE subject LIKE '[%s:] %' AND (task_type='EXTENSION' OR task_type='EXTENSION_UPDATE')", - array($name), __FILE__, __LINE__); + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_task_system WHERE subject LIKE '[%s:] %' AND (task_type='EXTENSION' OR task_type='EXTENSION_UPDATE')", + array($name), __FILE__, __LINE__); } // END - foreach // I think it's not neccessary to run the optimization function here