Make WordPress Core

Opened 5 years ago

Last modified 17 months ago

#46061 new defect (bug)

Canonical prevents accessing paginated results of feed-named tags

Reported by: dd32's profile dd32 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 2.7.1
Component: Canonical Keywords: needs-patch
Focuses: Cc:

Description

Given a tag of the name 'rss' (or any of (feed|rss|rdf|atom|rss2)) Canonical will cause a redirect for a paginated result to an incorrect url lacking the 'rss'

For example:

$ curl -Is http://wordpress.dev/tag/rss/page/2/ | grep Location
Location: http://wordpress.dev/tag/page/2/

This appears to be caused by https://core.trac.wordpress.org/browser/trunk/src/wp-includes/canonical.php?rev=43571&marks=297-302#L290

This was originally reported as https://meta.trac.wordpress.org/ticket/2945

Attachments (1)

46061-tests.diff (2.2 KB) - added by tellyworth 4 years ago.

Download all attachments as: .zip

Change History (6)

This ticket was mentioned in Slack in #slackhelp by tobifjellner. View the logs.


5 years ago

#2 @tellyworth
4 years ago

attachment:46061-tests.diff adds unit test cases to reproduce the problem. Example output:

There were 3 failures:

1) Tests_Canonical::test_canonical with data set #11 ('/tag/feed/page/2/', array('/tag/feed/page/2/', array('foo', '2')), 46061)
Ticket #46061
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'/tag/feed/page/2/'
+'/tag/page/2/'

2) Tests_Canonical::test_canonical with data set #12 ('/tag/rss/page/2/', array('/tag/rss/page/2/', array('rss', '2')), 46061)
Ticket #46061
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'/tag/rss/page/2/'
+'/tag/page/2/'

3) Tests_Canonical::test_canonical with data set #13 ('/category/atom/page/2/', array('/category/atom/page/2/', array('feed', '2')), 46061)
Ticket #46061
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'/category/atom/page/2/'
+'/category/page/2/'

Note that this is a similar bug to #39535.

#3 @tellyworth
4 years ago

See also #21700.

#4 @dd32
17 months ago

#56937 was marked as a duplicate.

#5 @dd32
17 months ago

  • Version set to 2.7.1

Per #56937 I traced this to likely being the result of [10505] / #8642.

Note: See TracTickets for help on using tickets.