Ticket #11969: theme-editor.diff

File theme-editor.diff, 1.8 KB (added by matdumsa, 3 years ago)

Path for this Ticket.. This patch was made from rev:13795

Line 
1Index: theme-editor.php
2===================================================================
3--- theme-editor.php    (revision 13795)
4+++ theme-editor.php    (working copy)
5@@ -31,7 +31,7 @@
6        wp_die(__('The requested theme does not exist.'));
7 
8 $allowed_files = array_merge($themes[$theme]['Stylesheet Files'], $themes[$theme]['Template Files']);
9-
10+$requestedfile = $file;
11 if (empty($file)) {
12        $file = $allowed_files[0];
13 } else {
14@@ -61,12 +61,12 @@
15                if ($f !== FALSE) {
16                        fwrite($f, $newcontent);
17                        fclose($f);
18-                       $location = "theme-editor.php?file=$file&theme=$theme&a=te&scrollto=$scrollto";
19+                       $location = "theme-editor.php?file=$requestedfile&theme=$theme&a=te&scrollto=$scrollto&dir=$dir";
20                } else {
21-                       $location = "theme-editor.php?file=$file&theme=$theme&scrollto=$scrollto";
22+                       $location = "theme-editor.php?file=$requestedfile&theme=$theme&scrollto=$scrollto&dir=$dir";
23                }
24        } else {
25-               $location = "theme-editor.php?file=$file&theme=$theme&scrollto=$scrollto";
26+               $location = "theme-editor.php?file=$requestedfile&theme=$theme&scrollto=$scrollto&dir=$dir";
27        }
28 
29        $location = wp_kses_no_null($location);
30@@ -197,7 +197,8 @@
31        <?php wp_nonce_field('edit-theme_' . $file . $theme) ?>
32                 <div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1" class="codepress <?php echo $codepress_lang ?>"><?php echo $content ?></textarea>
33                 <input type="hidden" name="action" value="update" />
34-                <input type="hidden" name="file" value="<?php echo esc_attr($file) ?>" />
35+                <input type="hidden" name="file" value="<?php echo esc_attr($requestedfile) ?>" />
36+                <input type="hidden" name="dir" value="<?php echo esc_attr($dir) ?>" />
37                 <input type="hidden" name="theme" value="<?php echo esc_attr($theme) ?>" />
38                 <input type="hidden" name="scrollto" id="scrollto" value="<?php echo $scrollto; ?>" />
39                 </div>