Plugins: Add file check to plugin deletions.

Merges [40169] to 4.1 branch.


Built from https://develop.svn.wordpress.org/branches/4.1@40176


git-svn-id: http://core.svn.wordpress.org/branches/4.1@40115 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Aaron Campbell 2017-03-06 13:03:54 +00:00
parent c5c1dce809
commit a0922a8e99
1 changed files with 8 additions and 0 deletions

View File

@ -226,6 +226,14 @@ if ( $action ) {
exit;
}
// Bail on all if any paths are invalid.
// validate_file() returns truthy for invalid files
$invalid_plugin_files = array_filter( $plugins, 'validate_file' );
if ( $invalid_plugin_files ) {
wp_redirect( self_admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") );
exit;
}
include(ABSPATH . 'wp-admin/update.php');
$parent_file = 'plugins.php';