Make WordPress Core

Opened 4 weeks ago

Last modified 4 weeks ago

#62007 new defect (bug)

PHP warning in wp-includes/canonical.php when accessing custom feed with specific permalink structure

Reported by: mt8biz's profile mt8.biz Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Canonical Keywords: has-patch
Focuses: Cc:

Description

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

Change History (1)

Note: See TracTickets for help on using tickets.