[wp-trac] [WordPress Trac] #49369: redirect_canonical() should strip trailing protocols (was: Phantom redirects)

WordPress Trac noreply at wordpress.org
Wed Feb 5 18:43:30 UTC 2020


#49369: redirect_canonical() should strip trailing protocols
------------------------------------------+------------------------------
 Reporter:  onlyonemj                     |       Owner:  (none)
     Type:  defect (bug)                  |      Status:  new
 Priority:  normal                        |   Milestone:  Awaiting Review
Component:  Canonical                     |     Version:  5.3.2
 Severity:  major                         |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:
------------------------------------------+------------------------------
Changes (by SergeyBiryukov):

 * keywords:  2nd-opinion dev-feedback needs-dev-note => needs-patch needs-
     unit-tests
 * focuses:  rest-api =>
 * component:  HTTP API => Canonical


Comment:

 Hi there, welcome to WordPress Trac! Thanks for the report.

 Replying to [ticket:49369 onlyonemj]:
 > This issue persists - likely a bug in WordPress redirect API. Anybody
 care to replicate and confirm? Is this a bug?

 Yes, this appears to be an issue with the `redirect_canonical()` function,
 which [source:tags/5.3.2/src/wp-includes/canonical.php?marks=516-519#L510
 strips multiple slashes from URL], but doesn't handle a case like this. It
 seems stripping `http://` completely would be the expected behavior here.

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


More information about the wp-trac mailing list