Fix for wrong SQL statement 'LOW_PRIRITY'
[mailer.git] / inc / loader / load-extension.php
index 9d2d351d83af0b2541bc713468c77400af702508..ac83a0f81397493d422e4fe9513a096877f58fe6 100644 (file)
@@ -149,8 +149,15 @@ if (($GLOBALS['cache_instance']->loadCacheFile('extension')) && ($GLOBALS['cache
        while ($content = SQL_FETCHARRAY($result)) {
                // Load extension
                if (!loadExtension($content['ext_name'], 'test')) {
-                       // Didn't load so deactivate it
-                       doDeactivateExtension($content['ext_name'], true);
+                       // 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;