[wp-trac] [WordPress Trac] #62007: PHP warning in wp-includes/canonical.php when accessing custom feed with specific permalink structure

WordPress Trac noreply at wordpress.org
Sat Sep 7 21:34:44 UTC 2024


#62007: PHP warning in wp-includes/canonical.php when accessing custom feed with
specific permalink structure
--------------------------+-----------------------------
 Reporter:  mt8.biz       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Canonical     |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Problem:
 Path lookup fails within `redirect_canonical()` when accessing custom
 feeds for certain permalink structures.

 Error Message:


 {{{
 <b>Warning</b>:  Undefined array key "path" in <b>/path/to/wordpress/wp-
 includes/canonical.php</b> on line <b>618</b><br />
 <br />
 <b>Warning</b>:  Undefined array key "path" in <b>/path/to/wordpress/wp-
 includes/ccanonical.php</b> on line <b>618</b><br />
 <br />
 <b>Warning</b>:  Undefined array key "path" in <b>/path/to/wordpress/wp-
 includes/ccanonical.php</b> on line <b>730</b><br />
 <error>
 }}}


 Error location (6.6 branch):
 https://github.com/WordPress/wordpress-develop/blob/6.6/src/wp-
 includes/canonical.php#L617-L618
 https://github.com/WordPress/wordpress-develop/blob/6.6/src/wp-
 includes/canonical.php#L730

 Reproduction steps:
 - Install WordPress 6.6.1
 - Set permalink structure to `/%category%/%post_id%`
 - Access {WordPress URL}/?feed=test

 *`?feed=test` is a non-existent feed template

 Version confirmed this issue:
 WordPress: 6.6.1
 Theme: Twenty Twenty-Four
 Plugin: None

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62007>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list