[wp-trac] [WordPress Trac] #16859: esc_url eats square brackets.

WordPress Trac noreply at wordpress.org
Wed Oct 7 23:35:34 UTC 2015


#16859: esc_url eats square brackets.
--------------------------+--------------------------
 Reporter:  f00f          |       Owner:  johnbillion
     Type:  defect (bug)  |      Status:  accepted
 Priority:  normal        |   Milestone:  4.4
Component:  Formatting    |     Version:  3.1
 Severity:  major         |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+--------------------------
Changes (by johnbillion):

 * keywords:  needs-patch => has-patch
 * milestone:  Future Release => 4.4


Comment:

 So here's a thing. Square brackets are stripped out when using
 `esc_url()`. This means URLs with square brackets in the path or query are
 broken, and IPv6 literal URLs are broken.

 [34675] attempted to fix both issues at once, but the tests failed due to
 `parse_url()` not being able to handle IPv6 literal URLs in PHP < 5.4.7.
 However the original intention was never to fix IPv6 literals - it was a
 side effect.

 To that end, the IPv6 tests can be removed, and we end up with:

  1. Square brackets correctly handled in paths and queries.
  2. IPv6 literal URLs consequentially fixed in PHP > 5.4.7.

 There is no down-side to reimplementing [34674], minus its IPv6 tests.

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


More information about the wp-trac mailing list