[wp-trac] [WordPress Trac] #63224: Undefined array key "QUERY_STRING" in _wp_get_site_editor_redirection_url()

WordPress Trac noreply at wordpress.org
Thu Apr 3 13:58:18 UTC 2025


#63224: Undefined array key "QUERY_STRING" in _wp_get_site_editor_redirection_url()
-------------------------------------------------+-------------------------
 Reporter:  akshaydhere                          |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  6.8
Component:  Editor                               |     Version:  trunk
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing has-         |     Focuses:  php-
  testing-info                                   |  compatibility
-------------------------------------------------+-------------------------
Changes (by tusharaddweb):

 * keywords:  has-patch needs-testing needs-testing-info => has-patch needs-
     testing has-testing-info


Comment:

 **Test Summary:**
 A warning message was encountered while accessing the WordPress Site
 Editor under the Twenty Twenty-Five theme in WordPress version 6.8-RC2
 with PHP 8.2.27. The issue was not reproducible in the local environment
 or WordPress Playground.

 **Test Environment:**

 WordPress Version: 6.8-RC2 (development version)

 PHP Version: 8.2.27

 Theme: Twenty Twenty-Five 1.1

 Testing Environments:

 Local WordPress installation

 WordPress Playground

 **Steps to Reproduce:**

 Navigate to WordPress Admin Panel.

 Go to Appearance > Editor.

 Observe if any warnings or errors appear.

 **Observed Results:**

 Locally, no warning messages were observed.

 In WordPress Playground, no warning messages were observed.

 However, in a specific instance, the following warning appeared:

 **Warnings:**

 Warning: Undefined array key "QUERY_STRING" in .../site-editor.php on line
 34

 Warning: Cannot modify header information - headers already sent by
 (output started at .../site-editor.php on line 34) in .../wp-admin/admin-
 header.php on line 14

 **Expected Results:**

 The Site Editor should open without any warnings or errors.

 **Possible Causes & Analysis:**

 The issue might be environment-specific and could be triggered under
 certain server configurations.

 The QUERY_STRING key might not always be set in the $_SERVER superglobal,
 leading to an undefined array key warning.

 The warning output might cause early header output, leading to the headers
 already sent issue.

 A recent change in WordPress 6.8-RC2 might be affecting this behavior.

 **Recommendations & Next Steps:**

 **Debugging Approach:**

 Check $_SERVER contents before accessing QUERY_STRING.

 Modify site-editor.php line 34 to ensure the key exists before usage:

 $query_string = $_SERVER['QUERY_STRING'] ?? '';

 **Verify Reproducibility in Other Setups:**

 Test in a fresh WordPress installation with PHP 8.2.27.

 Check if the issue persists across different hosting environments.

 **Report to WordPress Core Team:**

 If the issue is confirmed, report it as a bug in the WordPress Core Trac
 or GitHub.

 **Conclusion:**
 The issue was observed in a specific scenario but was not reproducible in
 all environments. Further investigation is needed to determine the root
 cause and provide a fix if necessary.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63224#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list