Ticket #11969: theme-editor.diff
File theme-editor.diff, 1.8 KB (added by , 15 years ago) |
---|
-
theme-editor.php
31 31 wp_die(__('The requested theme does not exist.')); 32 32 33 33 $allowed_files = array_merge($themes[$theme]['Stylesheet Files'], $themes[$theme]['Template Files']); 34 34 $requestedfile = $file; 35 35 if (empty($file)) { 36 36 $file = $allowed_files[0]; 37 37 } else { … … 61 61 if ($f !== FALSE) { 62 62 fwrite($f, $newcontent); 63 63 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"; 65 65 } 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"; 67 67 } 68 68 } 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"; 70 70 } 71 71 72 72 $location = wp_kses_no_null($location); … … 197 197 <?php wp_nonce_field('edit-theme_' . $file . $theme) ?> 198 198 <div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1" class="codepress <?php echo $codepress_lang ?>"><?php echo $content ?></textarea> 199 199 <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) ?>" /> 201 202 <input type="hidden" name="theme" value="<?php echo esc_attr($theme) ?>" /> 202 203 <input type="hidden" name="scrollto" id="scrollto" value="<?php echo $scrollto; ?>" /> 203 204 </div>