[wp-trac] [WordPress Trac] #30373: wp_make_link_relative() isn't

WordPress Trac noreply at wordpress.org
Mon Nov 17 23:06:51 UTC 2014


#30373: wp_make_link_relative() isn't
--------------------------+-----------------------------
 Reporter:  dd32          |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 #30372 added a unit test to show `wp_make_link_relative()` working, so I
 took a look and spotted a few problems with the function:
  - It doesn't handle schemeless url's
  - It doesn't handle relative URL's with a URL in a parameter.

 This example shows both failings:
 `var_dump( wp_make_link_relative(
 "//something.com/blah/blah?blah=http://example.com/ex" ) );` resulting in
 `//something.com/blah/blah?blah=/ex`

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


More information about the wp-trac mailing list