[wp-trac] [WordPress Trac] #34958: esc_url() and parse_url() do not work together.

WordPress Trac noreply at wordpress.org
Fri Dec 11 19:33:27 UTC 2015


#34958: esc_url() and parse_url() do not work together.
-------------------------------+------------------------------
 Reporter:  damiankaelgreen    |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Formatting         |     Version:  4.4
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by johnbillion):

 * keywords:   => reporter-feedback
 * component:  General => Formatting


Comment:

 Thanks for the report, @damiankaelgreen .

 This is expected behaviour, as `esc_url()` escapes the ampersand in the
 URL, converting it to `&`. `parse_url()` is not intended to work with
 escaped ampersands.

 It may be that you should be using `esc_url_raw()` in this particular
 case, as `esc_url()` is meant to be used late to escape a URL for output.

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


More information about the wp-trac mailing list