X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/6c8f14c09105d0afa4c1574215c59b5021040e76..53a5df18dd17a11c18781e78349feb3e139096b4:/wp-admin/theme-editor.php diff --git a/wp-admin/theme-editor.php b/wp-admin/theme-editor.php index c9adabe0..7d1c6189 100644 --- a/wp-admin/theme-editor.php +++ b/wp-admin/theme-editor.php @@ -7,7 +7,7 @@ */ /** WordPress Administration Bootstrap */ -require_once('./admin.php'); +require_once( dirname( __FILE__ ) . '/admin.php' ); if ( is_multisite() && ! is_network_admin() ) { wp_redirect( network_admin_url( 'theme-editor.php' ) ); @@ -26,11 +26,11 @@ get_current_screen()->add_help_tab( array( 'content' => '

' . __('You can use the Theme Editor to edit the individual CSS and PHP files which make up your theme.') . '

' . __('Begin by choosing a theme to edit from the dropdown menu and clicking Select. A list then appears of all the template files. Clicking once on any file name causes the file to appear in the large Editor box.') . '

-

' . __('For PHP files, you can use the Documentation dropdown to select from functions recognized in that file. Lookup takes you to a web page with reference material about that particular function.') . '

+

' . __('For PHP files, you can use the Documentation dropdown to select from functions recognized in that file. Look Up takes you to a web page with reference material about that particular function.') . '

' . __('In the editing area the Tab key enters a tab character. To move below this area by pressing Tab, press the Esc key followed by the Tab key.') . '

' . __('After typing in your edits, click Update File.') . '

' . __('Advice: think very carefully about your site crashing if you are live-editing the theme currently in use.') . '

-

' . __('Upgrading to a newer version of the same theme will override changes made here. To avoid this, consider creating a child theme instead.') . '

' . +

' . sprintf( __('Upgrading to a newer version of the same theme will override changes made here. To avoid this, consider creating a child theme instead.'), __('http://codex.wordpress.org/Child_Themes') ) . '

' . ( is_network_admin() ? '

' . __('Any edits to files from this screen will be reflected on all sites in the network.') . '

' : '' ) ) ); @@ -68,7 +68,7 @@ if ( empty( $file ) ) { $relative_file = 'style.css'; $file = $allowed_files['style.css']; } else { - $relative_file = stripslashes( $file ); + $relative_file = $file; $file = $theme->get_stylesheet_directory() . '/' . $relative_file; } @@ -78,7 +78,7 @@ $scrollto = isset( $_REQUEST['scrollto'] ) ? (int) $_REQUEST['scrollto'] : 0; switch( $action ) { case 'update': check_admin_referer( 'edit-theme_' . $file . $stylesheet ); - $newcontent = stripslashes( $_POST['newcontent'] ); + $newcontent = wp_unslash( $_POST['newcontent'] ); $location = 'theme-editor.php?file=' . urlencode( $relative_file ) . '&theme=' . urlencode( $stylesheet ) . '&scrollto=' . $scrollto; if ( is_writeable( $file ) ) { //is_writable() not always reliable, check return value. see comments @ http://uk.php.net/is_writable @@ -112,7 +112,7 @@ default: $functions = wp_doc_link_parse( $content ); $docs_select = ' +