[wp-trac] [WordPress Trac] #47980: New wp_validate_redirect() removes domain in some circumstances.

WordPress Trac noreply at wordpress.org
Sun Oct 13 01:54:36 UTC 2019


#47980: New wp_validate_redirect() removes domain in some circumstances.
--------------------------+-----------------------------
 Reporter:  rconde        |       Owner:  SergeyBiryukov
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  5.2.4
Component:  General       |     Version:  5.2.3
 Severity:  critical      |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+-----------------------------

Comment (by peterwilsoncc):

 ''The WP unit tests don't include a Windows machine. If someone could run
 the unit tests on a Windows machine (ie, not in the docker container
 provided) and report back, that would be most helpful.''

 In [attachment:"47980.diff"]

 * switched to using `wp_normalize_path()` before left trimming the URL.
 This ensures the `dirname()` output is converted to `/` throughout and
 keeps path normalization DRY
 * Added some unit tests for validating redirects without hostnames

 Test results found here https://github.com/WordPress/wordpress-
 develop/pull/108/checks

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


More information about the wp-trac mailing list