]> git.mxchange.org Git - mailer.git/blobdiff - inc/loader/load-extension.php
Fix for wrong SQL statement 'LOW_PRIRITY'
[mailer.git] / inc / loader / load-extension.php
index f68a0abfcbe59442b7cbd12bb1d31eca73bb376d..ac83a0f81397493d422e4fe9513a096877f58fe6 100644 (file)
@@ -148,7 +148,20 @@ if (($GLOBALS['cache_instance']->loadCacheFile('extension')) && ($GLOBALS['cache
        // 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_PRIORITY 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));