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;