Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/theme-editor.php

    r12185 r12310  
    3636    $file = $allowed_files[0];
    3737} else {
     38    $file = stripslashes($file);
    3839    if ( 'theme' == $dir ) {
    3940        $file = dirname(dirname($themes[$theme]['Template Dir'])) . $file ;
     
    4344}
    4445
    45 $real_file = validate_file_to_edit($file, $allowed_files);
     46validate_file_to_edit($file, $allowed_files);
    4647$scrollto = isset($_REQUEST['scrollto']) ? (int) $_REQUEST['scrollto'] : 0;
    47 
    4848$file_show = basename( $file );
    4949
     
    5656    $newcontent = stripslashes($_POST['newcontent']);
    5757    $theme = urlencode($theme);
    58     if (is_writeable($real_file)) {
     58    if (is_writeable($file)) {
    5959        //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+');
    6161        if ($f !== FALSE) {
    6262            fwrite($f, $newcontent);
     
    8484    update_recently_edited($file);
    8585
    86     if ( !is_file($real_file) )
     86    if ( !is_file($file) )
    8787        $error = 1;
    8888
    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, '.' ) ) ) {
    9494            $functions = wp_doc_link_parse( $content );
    9595
     
    103103
    104104        $content = htmlspecialchars( $content );
    105         $codepress_lang = codepress_get_lang($real_file);
     105        $codepress_lang = codepress_get_lang($file);
    106106    }
    107107
     
    213213
    214214        <div>
    215 <?php if ( is_writeable($real_file) ) : ?>
     215<?php if ( is_writeable($file) ) : ?>
    216216            <p class="submit">
    217217<?php
Note: See TracChangeset for help on using the changeset viewer.