[wp-trac] [WordPress Trac] #21602: redirect_canonical can lead to infinite loop on index navigation if site url is not all lower case

WordPress Trac noreply at wordpress.org
Tue Jan 12 02:49:41 UTC 2016


#21602: redirect_canonical can lead to infinite loop on index navigation if site
url is not all lower case
----------------------------------------+--------------------
 Reporter:  sreedoap                    |       Owner:
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  4.4.2
Component:  Canonical                   |     Version:
 Severity:  normal                      |  Resolution:
 Keywords:  needs-unit-tests has-patch  |     Focuses:
----------------------------------------+--------------------
Changes (by dd32):

 * keywords:  needs-unit-tests needs-refresh => needs-unit-tests has-patch


Comment:

 Here's the options and my thoughts on each

 * Revert to 4.3 behaviour, which requires reverts of #35031 & #33920 - the
 result would be that If you embed a post on a page and then they rename
 the slug, your embed will break.

 * [attachment:21602.3.diff] Lowercase hostname - Not 4.4.x material IMHO,
 possibly something we could consider, probably not worth it really though
 for a UX perspective, it should just work.
 * [attachment:21602.4.diff] Simply replaces the hostname in
 `$redirect_url` just incase it's not rebuilt a few lines later, seems like
 a waste of resources when the next two options exist:
 * [attachment:21602.2.diff] simpler than [attachment:21602.4.diff] and
 effectively the same. I don't understand why we don't just rebuild the URL
 each time if we're modifying the contents of the array above often. This
 would need testing with a scenario where there's multiple hostnames though
 * [attachment:21602.diff] Also makes sense, triggers the `$redirect_url`
 rebuilding with any URL change, but at that point we might as well
 simplify it with [attachment:21602.2.diff]
 * [attachment:21602.patch] also works, but I think it only works because
 it doesn't trigger a redirect in some cases where we do want one or vice-
 versa.

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


More information about the wp-trac mailing list