From 10a2dd32cf19d284e3f2255bf40801567b4da18a Mon Sep 17 00:00:00 2001 From: Aaron Campbell Date: Mon, 6 Mar 2017 13:00:33 +0000 Subject: [PATCH] Plugins: Add file check to plugin deletions. Merges [40169] to 4.5 branch. Built from https://develop.svn.wordpress.org/branches/4.5@40172 git-svn-id: http://core.svn.wordpress.org/branches/4.5@40111 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/plugins.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php index 4530831bc8..fde886e46d 100644 --- a/wp-admin/plugins.php +++ b/wp-admin/plugins.php @@ -246,6 +246,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';