Make WordPress Core


Ignore:
Timestamp:
07/02/2008 11:07:56 PM (17 years ago)
Author:
mdawaffe
Message:

crazyhorse: merge with log:trunk@8151:8240

File:
1 edited

Legend:

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

    r7979 r8242  
    4444    $theme = urlencode($theme);
    4545    if (is_writeable($real_file)) {
     46        //is_writable() not always reliable, check return value. see comments @ http://uk.php.net/is_writable
    4647        $f = fopen($real_file, 'w+');
    47         fwrite($f, $newcontent);
    48         fclose($f);
    49         $location = "theme-editor.php?file=$file&theme=$theme&a=te";
     48        if ($f !== FALSE) {
     49            fwrite($f, $newcontent);
     50            fclose($f);
     51            $location = "theme-editor.php?file=$file&theme=$theme&a=te";
     52        } else {
     53            $location = "theme-editor.php?file=$file&theme=$theme";
     54        }
    5055    } else {
    5156        $location = "theme-editor.php?file=$file&theme=$theme";
Note: See TracChangeset for help on using the changeset viewer.