Changes in trunk/wp-admin/theme-editor.php [12185:12310]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/theme-editor.php
r12185 r12310 36 36 $file = $allowed_files[0]; 37 37 } else { 38 $file = stripslashes($file); 38 39 if ( 'theme' == $dir ) { 39 40 $file = dirname(dirname($themes[$theme]['Template Dir'])) . $file ; … … 43 44 } 44 45 45 $real_file =validate_file_to_edit($file, $allowed_files);46 validate_file_to_edit($file, $allowed_files); 46 47 $scrollto = isset($_REQUEST['scrollto']) ? (int) $_REQUEST['scrollto'] : 0; 47 48 48 $file_show = basename( $file ); 49 49 … … 56 56 $newcontent = stripslashes($_POST['newcontent']); 57 57 $theme = urlencode($theme); 58 if (is_writeable($ real_file)) {58 if (is_writeable($file)) { 59 59 //is_writable() not always reliable, check return value. see comments @ http://uk.php.net/is_writable 60 $f = fopen($ real_file, 'w+');60 $f = fopen($file, 'w+'); 61 61 if ($f !== FALSE) { 62 62 fwrite($f, $newcontent); … … 84 84 update_recently_edited($file); 85 85 86 if ( !is_file($ real_file) )86 if ( !is_file($file) ) 87 87 $error = 1; 88 88 89 if ( !$error && filesize($ real_file) > 0 ) {90 $f = fopen($ real_file, 'r');91 $content = fread($f, filesize($ real_file));92 93 if ( '.php' == substr( $ real_file, strrpos( $real_file, '.' ) ) ) {89 if ( !$error && filesize($file) > 0 ) { 90 $f = fopen($file, 'r'); 91 $content = fread($f, filesize($file)); 92 93 if ( '.php' == substr( $file, strrpos( $file, '.' ) ) ) { 94 94 $functions = wp_doc_link_parse( $content ); 95 95 … … 103 103 104 104 $content = htmlspecialchars( $content ); 105 $codepress_lang = codepress_get_lang($ real_file);105 $codepress_lang = codepress_get_lang($file); 106 106 } 107 107 … … 213 213 214 214 <div> 215 <?php if ( is_writeable($ real_file) ) : ?>215 <?php if ( is_writeable($file) ) : ?> 216 216 <p class="submit"> 217 217 <?php
Note: See TracChangeset
for help on using the changeset viewer.