Final (?) fix for #223
authorRoland Häder <roland@mxchange.org>
Tue, 31 Jul 2012 19:14:43 +0000 (19:14 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 31 Jul 2012 19:14:43 +0000 (19:14 +0000)
inc/loader/load-extension.php

index 9d2d351d83af0b2541bc713468c77400af702508..966df4784cad8480a8696cfe82d2b376b4a141f8 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_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;