uninitialized variable causes "sorry, that file cannot be edited"
|Reported by:||cwgservices||Owned by:|
This bug is present in both wp-admin/theme-editor.php and wp-admin/plugin-editor in version 2.9.1 of wordpress. Depending on what other plugins happen to be activated, i.e. what they happen to leave on the stack, there are times when any attempt to use the theme editor or plugin editor produces the error message. Deactivating a recently added plugin restores normal operation, but the bug is in the core rather than the plugin.
The variable $file is not initialized yet it is tested; if it happens to be nonempty the error will occur. The error comes from the subsequent call to validate_file_for_edit().
I am attaching the patched files that I am using until the core gets officially fixed. The changes are surrounded with comments including my initials (cwg). There is one patched section in each of the two files.
Change History (8)
- Keywords reporter-feedback added; editor theme-editor plugin-editor file cannot be edited removed
- Keywords has-patch commit added; reporter-feedback removed
- Milestone changed from Unassigned to 3.0