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

git-svn-id: http://svn.automattic.com/wordpress/trunk@10594 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-02-19 18:39:04 +00:00
parent 4290916159
commit ff2e6c8f34
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;
}