X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Floader%2Fload-extension.php;h=966df4784cad8480a8696cfe82d2b376b4a141f8;hb=be0e0d5fcd987f2069ceeb15e409e15b8781fe87;hp=420b5d4bd393f3eadd36e3166383d2df950f0100;hpb=20741b93fd58620af677a7f1039ffd16ea6ec689;p=mailer.git diff --git a/inc/loader/load-extension.php b/inc/loader/load-extension.php index 420b5d4bd3..966df4784c 100644 --- a/inc/loader/load-extension.php +++ b/inc/loader/load-extension.php @@ -139,14 +139,29 @@ if (($GLOBALS['cache_instance']->loadCacheFile('extension')) && ($GLOBALS['cache // Add more if sql_patches is recent enougth $add = ''; if (isExtensionInstalledAndNewer('sql_patches', '0.0.6')) { - $add = ', `ext_has_css` AS `ext_css`'; - } // END - if + $add = ',`ext_has_css` AS `ext_css`'; + } // END - if - // Load all modules and their data + // Query for all extensions $result = SQL_QUERY('SELECT `id` AS `ext_id`,`ext_name`,`ext_active`,`ext_version`' . $add . ' FROM `{?_MYSQL_PREFIX?}_extensions` ORDER BY `ext_name` ASC', __FILE__, __LINE__); + + // Load all entries while ($content = SQL_FETCHARRAY($result)) { // Load extension - loadExtension($content['ext_name'], 'test'); + if (!loadExtension($content['ext_name'], 'test')) { + // Is the name valid? + if (!isExtensionNameValid($content['ext_name'])) { + // Is not valid name (empty ext-foo.php script) + SQL_QUERY_ESC("DELETE LOW_PRIRITY FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `ext_name`='%s' LIMIT 1", + array($content['ext_name']), __FILE__, __LINE__); + } else { + // Didn't load so deactivate it + doDeactivateExtension($content['ext_name'], true); + } + + // ... and skip it + continue; + } // END - if // Get menu entry $content['ext_menu'] = convertBooleanToYesNo(ifModuleHasMenu($content['ext_name'], true));