[wp-trac] [WordPress Trac] #62355: WP sets REQUEST_URI to an invalid value if it's not set

WordPress Trac noreply at wordpress.org
Sun Dec 29 06:18:40 UTC 2024


#62355: WP sets REQUEST_URI to an invalid value if it's not set
--------------------------+------------------------------
 Reporter:  kkmuffme      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------------

Comment (by kkmuffme):

 >the PR doesn't make any sense.

 Why/What specifically?

 >1. Setting $_SERVER['REQUEST_URI'] to / will break any code which checks
 $_SERVER['REQUEST_URI'] to determine whether WordPress is running from the
 command-line (e.g., in WP-CLI).

 Please provide a code reference of WP-CLI please (github link)

 There is no sane reason to use REQUEST_URI to check if code is run from
 the command-line or not, so I doubt that you find any use cases for your
 claim.

 >2. The URL / will be nonsensical for WordPress installations that are not
 in the server document root - e.g., a WordPress installation at
 http://example.com/blog/. This could confuse any code which is attempting
 to parse the URL.

 Please explain how the current empty string is better in that case?

 >3. If WordPress is installed in the server document root, that may be
 even worse

 Can you please give me an example what you mean specifically?

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


More information about the wp-trac mailing list