diff --git a/wp-admin/theme-editor.php b/wp-admin/theme-editor.php index e7fd3fa88b..f82db5986d 100644 --- a/wp-admin/theme-editor.php +++ b/wp-admin/theme-editor.php @@ -121,9 +121,11 @@ $edit_error = null; $posted_content = null; if ( 'POST' === $_SERVER['REQUEST_METHOD'] ) { - $r = wp_edit_theme_plugin_file( wp_unslash( $_POST ) ); - if ( is_wp_error( $r ) ) { - $edit_error = $r; + $edit_result = wp_edit_theme_plugin_file( wp_unslash( $_POST ) ); + + if ( is_wp_error( $edit_result ) ) { + $edit_error = $edit_result; + if ( check_ajax_referer( 'edit-theme_' . $stylesheet . '_' . $relative_file, 'nonce', false ) && isset( $_POST['newcontent'] ) ) { $posted_content = wp_unslash( $_POST['newcontent'] ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 6b16006fcb..7b4f8e1c05 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.9-alpha-60931'; +$wp_version = '6.9-alpha-60932'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.