WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 5 months ago

#31935 new defect (bug)

is_page() erroneously set to true when loading /feed/ associated with 404

Reported by: danielbachhuber Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.0
Component: Feeds Keywords: has-patch has-unit-tests
Focuses: Cc:
PR Number:

Description

r29216 changed feeds to never send a 404 status header. This had the unintended consequence of changing the behavior of some internals.

A request to the feed associated with a missing page (e.g. /missing-page/feed/) will match the rewrite rule for a page and set is_page == true. I'd expect WordPress internals to still understand this request as is_404

Attachments (2)

31935.patch (431 bytes) - added by 5um17 5 years ago.
Patch checking not singular with is_feed
31935-unit-test.diff (953 bytes) - added by salcode 4 years ago.

Download all attachments as: .zip

Change History (8)

@5um17
5 years ago

Patch checking not singular with is_feed

#1 @5um17
5 years ago

  • Keywords has-patch added; needs-patch removed

This can be fixed by sending 200 status code only for home page feed. Therefore, I added !is_singular() along with is_feed()
Any other better way ?

#2 @johnbillion
5 years ago

  • Keywords needs-unit-tests added

#3 @swissspidy
4 years ago

  • Keywords has-unit-tests added; needs-unit-tests removed
  • Milestone changed from Future Release to 4.5

#4 @stevenkword
4 years ago

Relates to #30210, which is also slated for 4.5.

#5 @swissspidy
4 years ago

The unit test breaks when running the Tests_Query_VerbosePageRules tests because it assumes to be a feed for a (non-existant) category archive. Looks like that's what #30210 tries to fix.

#6 @jorbin
4 years ago

  • Milestone changed from 4.5 to Future Release

Punting this in coordination with #30210 as this relies on that and that one is blocked by #35452.

Note: See TracTickets for help on using tickets.