From 4e13bc0bea8706a064b8d3faea1b763fa3b70b52 Mon Sep 17 00:00:00 2001 From: "Aaron D. Campbell" Date: Mon, 6 Mar 2017 12:54:07 +0000 Subject: [PATCH] Plugins: Add file check to plugin deletions. git-svn-id: https://develop.svn.wordpress.org/trunk@40169 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/plugins.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/wp-admin/plugins.php b/src/wp-admin/plugins.php index 2eeea4eb9f..3d7ff016e5 100644 --- a/src/wp-admin/plugins.php +++ b/src/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';