[wp-trac] [WordPress Trac] #63733: Undefined array key "path" error coming from dynamically generated redirect paths

WordPress Trac noreply at wordpress.org
Tue Jul 22 16:23:53 UTC 2025


#63733: Undefined array key "path" error coming from dynamically generated redirect
paths
--------------------------+------------------------------
 Reporter:  chrismattix   |       Owner:  johnjamesjacoby
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  6.9
Component:  Canonical     |     Version:
 Severity:  normal        |  Resolution:  fixed
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------------
Changes (by johnjamesjacoby):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"60496" 60496]:
 {{{
 #!CommitTicketReference repository="" revision="60496"
 Canonical: prevent possible "Undefined array key" PHP error in
 `redirect_canonical()`, if the `path` or `query` array keys have gone
 missing.

 This commit checks for the existence of (and re-adds if necessary) the
 `path` and `query` array keys after the `$redirect` variable has
 potentially been replaced by a second call to `parse_url()`.

 This may happen when redirecting back to the root domain, without any path
 ('/example/`) or query (`?example=1`) to parse.

 Props chrismattix, dhruvang21.

 Fixes #63733.
 }}}

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


More information about the wp-trac mailing list