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.

Props akshaydhere, dilipbheda, johnbillion, rainynewt, sabernhardt, sainathpoojary, shovan_jaya, tusharaddweb, wildworks.
Fixes #63224.

Built from https://develop.svn.wordpress.org/trunk@60134


git-svn-id: http://core.svn.wordpress.org/trunk@59470 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Peter Wilson
2025-04-07 00:07:30 +00:00
parent d38b0e164c
commit 55aa83772d
2 changed files with 2 additions and 2 deletions

View File

@@ -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;
}

View File

@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.9-alpha-60132';
$wp_version = '6.9-alpha-60134';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.