Opened 18 years ago
Closed 17 years ago
#4448 closed defect (bug) (fixed)
Update theme files
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 2.6 | Priority: | high |
Severity: | normal | Version: | 2.2 |
Component: | Administration | Keywords: | has-patch |
Focuses: | Cc: |
Description
Hello, when I try to update theme files (in Presentation - Theme Editor), there is no change of this file after. There is message "File was successfully changed" but no change was saved. When I deactivate all plugins, then there is following error:
Warning: fopen(d:\WWW\www.test.cz/wp-content/themes/blue-lake-10/style.css) [function.fopen]: failed to open stream: Permission denied in d:\WWW\www.test.cz\wp-admin\theme-editor.php on line 44 Warning: fwrite(): supplied argument is not a valid stream resource in d:\WWW\www.test.cz\wp-admin\theme-editor.php on line 45 Warning: fclose(): supplied argument is not a valid stream resource in d:\WWW\www.test.cz\wp-admin\theme-editor.php on line 46 Warning: Cannot modify header information - headers already sent by (output started at d:\WWW\www.test.cz\wp-admin\theme-editor.php:44) in d:\WWW\www.test.cz\wp-admin\theme-editor.php on line 55
I found similar problems in support forum, for example http://wordpress.org/support/topic/105052 or http://wordpress.org/support/topic/78867
Thank you for your help...
Attachments (1)
Change History (12)
#3
@
18 years ago
- Resolution invalid deleted
- Status changed from closed to reopened
Yes, I had sometimes permission problems, but in this case, there was not button "Update File". In this case of bad permission of files, this button does not appear. But now - this button appears, but no change (update). I also tried to change chmod with no success. And what about message "File was successfully changed" but no change happens? Thank you for your help...
#9
@
17 years ago
Yes, it is possible to create this error in some situations. The theme editor does an is_writable check before attempting to write the file, but is_writable is not reliable in all situations and it can return true even if the file is not accessible.
In theme-editor.php, this code:
if (is_writeable($real_file)) { $f = fopen($real_file, 'w+'); fwrite($f, $newcontent); fclose($f); $location = "theme-editor.php?file=$file&theme=$theme&a=te"; } else { $location = "theme-editor.php?file=$file&theme=$theme"; }
...has no error checking on the fopen. $f needs to be compared to === FALSE before attempting to fwrite and fclose it.
If this happens, then there's not much that can be done about it. Are the files read-only or something? Either way, this is a permissions issue, not a Wordpress error.