#11712 closed defect (bug) (invalid)
Theme Editor -> "Sorry, that file cannot be edited."
Reported by: | Frumph | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Filesystem API | Keywords: | |
Focuses: | Cc: |
Description
What causes this error to come up, I heard it had something to do with a particular theme however it's still doing it with the default theme in wordpress 2.9.1 rc 1 and the svn 3.0 repo.
If this is a theme situation, what would cause this that I can look at in our code/plugins?
Change History (12)
#1
in reply to:
↑ description
@
15 years ago
#2
@
15 years ago
- Milestone Unassigned deleted
- Resolution set to invalid
- Status changed from new to closed
Please post your question on the support forums or on the wp-hackers mailing list, providing the path of the file you're trying to edit.
#3
@
15 years ago
- Resolution invalid deleted
- Status changed from closed to reopened
Reopening
function validate_file( in wp-includes/functions.php }} is returning $file as not a valid comparison to the array example: {{{ string(29) "/themes/comicpress/footer.php" }}} however the array: {{{ array(78) { [0]=> string(59) "C:\inetpub\localhost/wp-content/themes/comicpress/style.css" }}} because the C:\inetpub\localhost is there it will never come back with a correct value
#5
@
15 years ago
- Type changed from defect (bug) to enhancement
From the function doc:
A return value of '2' means that the $file contains ':' after the first character.
So it's documented behaviour.
No ideea why that restriction is imposed, so I'll leave it to someone more knowledgeable.
#7
@
15 years ago
if (':' == substr( $file, 1, 1 )) return 2;
Note that it's currently checking $file, while file is string(29) "/themes/comicpress/footer.php"
thats why it's returning 3 because it actually stop ahead of that line at this:
if (!empty ( $allowed_files ) && (!in_array( $file, $allowed_files ) ) ) return 3;
which is actually before the return 2 in the function validate_file
#8
@
15 years ago
..the bug here is that $file doesn't always return the full abspath with it so it doesn't match the array.
This is not an enhancement, it's a bug.
#10
@
15 years ago
Can you provide a link to the theme so other developers are more easy to reproduce the bug? That should help to solve the issue.
Replying to Frumph:
Yeah sorry, *NOT* doing it on default theme, so I know it's our theme, I just want to figure out what would cause it and clean that up in our theme.