From 2e807302cd72dd5e42b9293746193eb1516b4cc1 Mon Sep 17 00:00:00 2001 From: Aaron Campbell Date: Mon, 6 Mar 2017 13:02:26 +0000 Subject: [PATCH] Plugins: Add file check to plugin deletions. Merges [40169] to 4.3 branch. Built from https://develop.svn.wordpress.org/branches/4.3@40174 git-svn-id: http://core.svn.wordpress.org/branches/4.3@40113 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 75f2491705..269e159d03 100644 --- a/wp-admin/plugins.php +++ b/wp-admin/plugins.php @@ -231,6 +231,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';