[wp-trac] [WordPress Trac] #31300: redirect_canonical returns too early

WordPress Trac noreply at wordpress.org
Wed Feb 11 17:00:32 UTC 2015


#31300: redirect_canonical returns too early
---------------------------+-----------------------------
 Reporter:  stephenharris  |      Owner:
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Canonical      |    Version:  trunk
 Severity:  normal         |   Keywords:
  Focuses:                 |
---------------------------+-----------------------------
 If `$redirect_url` is not set or is not equal to `$requested_url` then
 `redirect_canonical()` returns early and does not trigger the
 `redirect_canonical` filter. This prevents plugins from being able to
 alter the canonical URL.

 This bug was partially addressed in #8975 (it still returned early when
 the redirect and requested URL are the same), but this was reverted in
 #11700 without any indication as to why.

 The attached patch ensures the filter triggers even when the
 `$redirect_url` is not set or is the same as `$requested_url`.

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


More information about the wp-trac mailing list