diff --git a/wp-admin/plugin-editor.php b/wp-admin/plugin-editor.php index 122362a527..2167c1ac74 100644 --- a/wp-admin/plugin-editor.php +++ b/wp-admin/plugin-editor.php @@ -27,10 +27,9 @@ $plugins = get_plugins(); if ( empty($plugins) ) wp_die( __('There are no plugins installed on this site.') ); -if ( isset($_REQUEST['file']) ) - $plugin = wp_unslash($_REQUEST['file']); - -if ( empty($plugin) ) { +if ( $file ) { + $plugin = $file; +} elseif ( empty( $plugin ) ) { $plugin = array_keys($plugins); $plugin = $plugin[0]; } diff --git a/wp-admin/theme-editor.php b/wp-admin/theme-editor.php index c8298d0c3b..2033a23845 100644 --- a/wp-admin/theme-editor.php +++ b/wp-admin/theme-editor.php @@ -68,7 +68,7 @@ if ( empty( $file ) ) { $relative_file = 'style.css'; $file = $allowed_files['style.css']; } else { - $relative_file = wp_unslash( $file ); + $relative_file = $file; $file = $theme->get_stylesheet_directory() . '/' . $relative_file; }