Deactivate plugins that don't have valid plugin headers. see #9164

git-svn-id: https://develop.svn.wordpress.org/trunk@10594 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2009-02-19 18:39:04 +00:00
parent bc444b8594
commit 260f87bd6e
1 changed files with 3 additions and 0 deletions

View File

@ -476,6 +476,9 @@ function validate_plugin($plugin) {
if ( ! file_exists(WP_PLUGIN_DIR . '/' . $plugin) )
return new WP_Error('plugin_not_found', __('Plugin file does not exist.'));
$installed_plugins = get_plugins();
if ( ! isset($installed_plugins[$plugin]) )
return new WP_Error('no_plugin_header', __('The plugin does not have a valid header.'));
return 0;
}