Changes in trunk/wp-admin/theme-editor.php [4349:3295]
- File:
-
- 1 edited
-
trunk/wp-admin/theme-editor.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/theme-editor.php
r4349 r3295 5 5 $parent_file = 'themes.php'; 6 6 7 wp_reset_vars(array('action', 'redirect', 'profile', 'error', 'warning', 'a', 'file', 'theme')); 7 $wpvarstoreset = array('action','redirect','profile','error','warning','a','file', 'theme'); 8 for ($i=0; $i<count($wpvarstoreset); $i += 1) { 9 $wpvar = $wpvarstoreset[$i]; 10 if (!isset($$wpvar)) { 11 if (empty($_POST["$wpvar"])) { 12 if (empty($_GET["$wpvar"])) { 13 $$wpvar = ''; 14 } else { 15 $$wpvar = $_GET["$wpvar"]; 16 } 17 } else { 18 $$wpvar = $_POST["$wpvar"]; 19 } 20 } 21 } 8 22 9 23 $themes = get_themes(); … … 17 31 18 32 if ( ! isset($themes[$theme]) ) 19 wp_die(__('The requested theme does not exist.'));33 die(__('The requested theme does not exist.')); 20 34 21 35 $allowed_files = array_merge($themes[$theme]['Stylesheet Files'], $themes[$theme]['Template Files']); … … 34 48 case 'update': 35 49 36 check_admin_referer('edit-theme_' . $file . $theme);37 38 50 if ( !current_user_can('edit_themes') ) 39 wp_die('<p>'.__('Youdo not have sufficient permissions to edit templates for this blog.').'</p>');51 die('<p>'.__('You have do not have sufficient permissions to edit templates for this blog.').'</p>'); 40 52 41 53 $newcontent = stripslashes($_POST['newcontent']); … … 45 57 fwrite($f, $newcontent); 46 58 fclose($f); 47 $location = "theme-editor.php?file=$file&theme=$theme&a=te";59 header("Location: theme-editor.php?file=$file&theme=$theme&a=te"); 48 60 } else { 49 $location = "theme-editor.php?file=$file&theme=$theme";61 header("Location: theme-editor.php?file=$file&theme=$theme"); 50 62 } 51 63 52 $location = wp_kses_no_null($location);53 $strip = array('%0d', '%0a');54 $location = str_replace($strip, '', $location);55 header("Location: $location");56 64 exit(); 57 65 … … 59 67 60 68 default: 61 69 70 require_once('admin-header.php'); 62 71 if ( !current_user_can('edit_themes') ) 63 wp_die('<p>'.__('You do not have sufficient permissions to edit themes for this blog.').'</p>'); 64 65 require_once('admin-header.php'); 72 die('<p>'.__('You have do not have sufficient permissions to edit themes for this blog.').'</p>'); 66 73 67 74 update_recently_edited($file); 68 75 69 76 if (!is_file($real_file)) 70 77 $error = 1; 71 78 72 79 if (!$error && filesize($real_file) > 0) { 73 80 $f = fopen($real_file, 'r'); … … 94 101 ?> 95 102 </select> 96 <input type="submit" name="Submit" value="<?php _e('Select »') ?>" class="button" />103 <input type="submit" name="Submit" value="<?php _e('Select') ?> »" /> 97 104 </form> 98 105 </div> … … 123 130 ?> 124 131 <form name="template" id="template" action="theme-editor.php" method="post"> 125 <?php wp_nonce_field('edit-theme_' . $file . $theme) ?>126 132 <div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1"><?php echo $content ?></textarea> 127 133 <input type="hidden" name="action" value="update" /> … … 132 138 <p class="submit"> 133 139 <?php 134 echo "<input type='submit' name='submit' value=' " . __('Update File »') . "' tabindex='2' />";140 echo "<input type='submit' name='submit' value=' " . __('Update File') . " »' tabindex='2' />"; 135 141 ?> 136 142 </p>
Note: See TracChangeset
for help on using the changeset viewer.