mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-21 22:15:28 +00:00
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:
parent
4290916159
commit
ff2e6c8f34
@ -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…
x
Reference in New Issue
Block a user