From 5b95f306331b04fffd80f688a72b02c9952adf8a Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Mon, 7 Apr 2025 22:15:30 +0000 Subject: [PATCH] Site Editor: Fix PHP warning in `_wp_get_site_editor_redirection_url()`. Fixes a PHP Warning for an undefined array key "QUERY_STRING" in `_wp_get_site_editor_redirection_url()` in some PHP configurations. Depending on the configuration, `$_SERVER['QUERY_STRING']` can either be unset or an empty string when no query string included in the URL. This changes the condition from a falsey check to an `empty()` check. Reviewed by Mamaduka. Merges [60134] to the 6.8 branch. Props akshaydhere, dilipbheda, johnbillion, rainynewt, sabernhardt, sainathpoojary, shovan_jaya, tusharaddweb, wildworks. Fixes #63224. Built from https://develop.svn.wordpress.org/branches/6.8@60135 git-svn-id: http://core.svn.wordpress.org/branches/6.8@59471 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/site-editor.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/site-editor.php b/wp-admin/site-editor.php index 0f1415ea9b..dba0c5981b 100644 --- a/wp-admin/site-editor.php +++ b/wp-admin/site-editor.php @@ -31,7 +31,7 @@ if ( ! current_user_can( 'edit_theme_options' ) ) { */ function _wp_get_site_editor_redirection_url() { global $pagenow; - if ( 'site-editor.php' !== $pagenow || isset( $_REQUEST['p'] ) || ! $_SERVER['QUERY_STRING'] ) { + if ( 'site-editor.php' !== $pagenow || isset( $_REQUEST['p'] ) || empty( $_SERVER['QUERY_STRING'] ) ) { return false; } diff --git a/wp-includes/version.php b/wp-includes/version.php index feeb01c964..fa6e09ebc2 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.8-RC2-60133'; +$wp_version = '6.8-RC2-60135'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.