[wp-trac] [WordPress Trac] #16859: esc_url eats square brackets. (was: Square brackets are removed from links in blogroll)

WordPress Trac wp-trac at lists.automattic.com
Tue May 29 13:40:18 UTC 2012


#16859: esc_url eats square brackets.
------------------------------------+------------------------------
 Reporter:  f00f                    |       Owner:  westi
     Type:  defect (bug)            |      Status:  accepted
 Priority:  normal                  |   Milestone:  Awaiting Review
Component:  General                 |     Version:  3.1
 Severity:  minor                   |  Resolution:
 Keywords:  has-patch dev-feedback  |
------------------------------------+------------------------------
Changes (by westi):

 * owner:  edwardw => westi


Old description:

> When adding a link to the blogroll (using wp-admin/link-add.php), square
> brackets in the link are removed, breaking the link.
>
> Example:
>
> {{{
> http://lokale-
> wochenzeitungen.de/index.php?id=485&tx_ttnews[pointer]=6&tx_ttnews[tt_news]=132583&tx_ttnews[backPid]=741&cHash=ee9c87874b
> }}}
>
> becomes
>
> {{{
> http://lokale-
> wochenzeitungen.de/index.php?id=485&tx_ttnewspointer=6&tx_ttnewstt_news=132583&tx_ttnewsbackPid=741&cHash=ee9c87874b
> }}}
>
> Workaround: Use URL-encoded links (%5B and %5D instead of [ and ]).

New description:

 When adding a link to the blogroll (using wp-admin/link-add.php), square
 brackets in the link are removed, breaking the link.

 Example:

 {{{
 http://lokale-
 wochenzeitungen.de/index.php?id=485&tx_ttnews[pointer]=6&tx_ttnews[tt_news]=132583&tx_ttnews[backPid]=741&cHash=ee9c87874b
 }}}

 becomes

 {{{
 http://lokale-
 wochenzeitungen.de/index.php?id=485&tx_ttnewspointer=6&tx_ttnewstt_news=132583&tx_ttnewsbackPid=741&cHash=ee9c87874b
 }}}

 Workaround: Use URL-encoded links (%5B and %5D instead of [ and ]).

 This also affects urls which are made clickable by {{{make_clickable}}

--

Comment:

 I've changed my mind about this as it affects a number of places and I
 think we do better to patch esc_url to fix this for [] by encoding them
 for you.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16859#comment:13>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list