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
This commit is contained in:
Peter Wilson
2025-04-07 22:15:30 +00:00
parent 1236aa9aa1
commit 5b95f30633
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.8-RC2-60133';
$wp_version = '6.8-RC2-60135';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.