[wp-trac] [WordPress Trac] #30869: Output of `esc_url`

WordPress Trac noreply at wordpress.org
Wed Dec 31 04:00:46 UTC 2014


#30869: Output of `esc_url`
--------------------------+-----------------------------
 Reporter:  rabmalin      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 {{{
 $args = array(
  'autofocus[control]' => 'blogname',
 );
 $url = add_query_arg( $args, admin_url('customize.php' ));
 echo esc_url($url);
 }}}

 Current output:
 `http://staging.dev/wp-admin/customize.php?autofocuscontrol=blogname`

 Expected output:
 `http://staging.dev/wp-admin/customize.php?autofocus[control]=blogname`

 I was trying to generate auto focus URL for customize page. I generally
 use `esc_url` to escape any URL in WordPress. But I could not produce
 expected URL when URL is escaped with the function. Is this expected
 feature of the function? Can someone please help make me clear about this?
 Thanks.

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


More information about the wp-trac mailing list