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:
parent
bc444b8594
commit
260f87bd6e
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user