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

WordPress Trac noreply at wordpress.org
Wed Aug 6 12:12:57 UTC 2025


#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-unit-tests has-patch needs-    |     Focuses:
  testing                                        |
-------------------------------------------------+-------------------------

Comment (by sainathpoojary):

 == Test Report
 === Description
 This report verifies that the patch correctly resolves the issue where
 URLs containing mid-path protocols (such as `/http://` or `/https://`)
 were not properly redirected by redirect_canonical().

 Patch tested: https://github.com/WordPress/wordpress-develop/pull/9194

 === Environment
 - WordPress: 6.9-alpha-60093-src
 - PHP: 8.2.28
 - Server: nginx/1.29.0
 - Database: mysqli (Server: 8.4.5 / Client: mysqlnd 8.2.28)
 - Browser: Chrome 138.0.0.0
 - OS: macOS
 - Theme: Twenty Twenty-Five 1.2
 - MU Plugins: None activated
 - Plugins: Test Reports 1.2.0

 === Actual Results
 ✅ With the patch applied, URLs containing mid-path protocol fragments are
 now correctly redirected to their canonical form.


 === Supplemental Artifacts
 Before:
 [[Image(https://rioudcpuyg.ufs.sh/f/PL8E4NiPUWyOl539NOUFvL3unmS7e6ZWRODwrzf2jyCcBM9A)]]

 After:
 [[Image(https://rioudcpuyg.ufs.sh/f/PL8E4NiPUWyOHUykYo2N2bxKiQ70vpC8rdRhegntWU63YfIz)]]

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


More information about the wp-trac mailing list