Skip to content

Commit 181c876

Browse files
committed
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. git-svn-id: https://develop.svn.wordpress.org/trunk@60134 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 4287e30 commit 181c876

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wp-admin/site-editor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
*/
3232
function _wp_get_site_editor_redirection_url() {
3333
global $pagenow;
34-
if ( 'site-editor.php' !== $pagenow || isset( $_REQUEST['p'] ) || ! $_SERVER['QUERY_STRING'] ) {
34+
if ( 'site-editor.php' !== $pagenow || isset( $_REQUEST['p'] ) || empty( $_SERVER['QUERY_STRING'] ) ) {
3535
return false;
3636
}
3737

0 commit comments

Comments
 (0)