Make WordPress Core

Changeset 60135


Ignore:
Timestamp:
04/07/2025 10:13:27 PM (3 weeks ago)
Author:
peterwilsoncc
Message:

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.

Location:
branches/6.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.8

  • branches/6.8/src/wp-admin/site-editor.php

    r60061 r60135  
    3232function _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    }
Note: See TracChangeset for help on using the changeset viewer.