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';