From 35c5d672685d57fd13c9ab9822baa1b699f100e2 Mon Sep 17 00:00:00 2001
From: Davit Barbakadze <jayarjo@gmail.com>
Date: Fri, 27 Jun 2014 15:03:55 +0400
Subject: [PATCH] Straighten active plugin/file picking logic in
plugin-editor.php.
Address 24122.
---
wp-admin/plugin-editor.php | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/wp-admin/plugin-editor.php b/wp-admin/plugin-editor.php
index 1c24295..231be43 100644
a
|
b
|
if ( empty( $plugins ) ) { |
36 | 36 | exit; |
37 | 37 | } |
38 | 38 | |
39 | | if ( $file ) { |
40 | | $plugin = $file; |
41 | | } elseif ( empty( $plugin ) ) { |
| 39 | if ( empty( $plugin ) ) { |
42 | 40 | $plugin = array_keys($plugins); |
43 | 41 | $plugin = $plugin[0]; |
44 | 42 | } |
45 | 43 | |
46 | | $plugin_files = get_plugin_files($plugin); |
47 | | |
48 | 44 | if ( empty($file) ) |
49 | | $file = $plugin_files[0]; |
| 45 | $file = $plugin; |
| 46 | |
| 47 | $plugin_files = get_plugin_files($file); |
50 | 48 | |
51 | 49 | $file = validate_file_to_edit($file, $plugin_files); |
52 | 50 | $real_file = WP_PLUGIN_DIR . '/' . $file; |