Theme editing not allowed
-
I had a year ago problems with updating to a newer version of WordPress (from 2.8.6 to 3.0.1) on a test installation. Whatever I tried (disabling plugins, standard theme, checking database) I kept on getting the error
Sorry, can’t edit files with “..” in the name. If you are trying to edit a file in your WordPress home directory, you can just type the name of the file in.
Since my real blog is still running 2.8.6 I want to update it. So I gave it a new try with an update. Unfortunately with no success, the error just came back. I also couldn’t login due to another error:
Warning: main(./wp-load.php) [function.main]: failed to open stream: No such file or directory in ./admin.php on line 30
I don’t know if there is a relationship between the two errors, but this is how I solved it.
in admin.php (included in the directory wp-admin) I added a . before /wp-load.phpThat solved the login problem
In file.php (included in wp-admin/include) I commented out the die statement in the validate_file function so it looks like this:
function validate_file_to_edit( $file, $allowed_files = ” ) {
$code = validate_file( $file, $allowed_files );if (!$code )
return $file;switch ( $code ) {
//case 1 :
// wp_die( __(‘Sorry, can’t edit files with “..” in the name. If you are trying to edit a file in your WordPress home directory, you can just type the name of the file in.’ ));//case 2 :
// wp_die( __(‘Sorry, can’t call files with their real path.’ ));case 3 :
wp_die( __(‘Sorry, that file cannot be edited.’ ));
}
}I think this is a hard way, but at least I am able to work on the themes again with a newer WP version.
If anyone has a better solution (again, I have tried to disable the plugins etc), please let me know.
- The topic ‘Theme editing not allowed’ is closed to new replies.