Make WordPress Core

Ticket #11969: theme-editor.diff

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

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

  • theme-editor.php

     
    3131        wp_die(__('The requested theme does not exist.'));
    3232
    3333$allowed_files = array_merge($themes[$theme]['Stylesheet Files'], $themes[$theme]['Template Files']);
    34 
     34$requestedfile = $file;
    3535if (empty($file)) {
    3636        $file = $allowed_files[0];
    3737} else {
     
    6161                if ($f !== FALSE) {
    6262                        fwrite($f, $newcontent);
    6363                        fclose($f);
    64                         $location = "theme-editor.php?file=$file&theme=$theme&a=te&scrollto=$scrollto";
     64                        $location = "theme-editor.php?file=$requestedfile&theme=$theme&a=te&scrollto=$scrollto&dir=$dir";
    6565                } else {
    66                         $location = "theme-editor.php?file=$file&theme=$theme&scrollto=$scrollto";
     66                        $location = "theme-editor.php?file=$requestedfile&theme=$theme&scrollto=$scrollto&dir=$dir";
    6767                }
    6868        } else {
    69                 $location = "theme-editor.php?file=$file&theme=$theme&scrollto=$scrollto";
     69                $location = "theme-editor.php?file=$requestedfile&theme=$theme&scrollto=$scrollto&dir=$dir";
    7070        }
    7171
    7272        $location = wp_kses_no_null($location);
     
    197197        <?php wp_nonce_field('edit-theme_' . $file . $theme) ?>
    198198                 <div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1" class="codepress <?php echo $codepress_lang ?>"><?php echo $content ?></textarea>
    199199                 <input type="hidden" name="action" value="update" />
    200                  <input type="hidden" name="file" value="<?php echo esc_attr($file) ?>" />
     200                 <input type="hidden" name="file" value="<?php echo esc_attr($requestedfile) ?>" />
     201                 <input type="hidden" name="dir" value="<?php echo esc_attr($dir) ?>" />
    201202                 <input type="hidden" name="theme" value="<?php echo esc_attr($theme) ?>" />
    202203                 <input type="hidden" name="scrollto" id="scrollto" value="<?php echo $scrollto; ?>" />
    203204                 </div>