[wp-trac] [WordPress Trac] #46791: esc_url() adding http:// to a relative URL to parent directory '../pathname/'

WordPress Trac noreply at wordpress.org
Thu Apr 4 09:50:03 UTC 2019


#46791: esc_url() adding http:// to a relative URL to parent directory
'../pathname/'
-----------------------------+-----------------------------
 Reporter:  OrangePixelNath  |      Owner:  (none)
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  General          |    Version:  5.1
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 {{{esc_url()}}} adds '!http://' when it shouldn't.

 Line 4191 wp-includes/formatting.php states
     If the URL doesn't appear to contain a scheme, we presume it needs
 !http:// prepended (unless a relative link starting with /, # or ? or a
 php file).

 This is prepending !http:// to a relative url to a parent directory i.e.
 '''../path-to-page/'''

 Funtion needs ../ adding to the array or some regex code.

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


More information about the wp-trac mailing list