[wp-trac] [WordPress Trac] #23605: esc_url() strips spaces instead of encoding them

WordPress Trac noreply at wordpress.org
Mon Feb 25 17:41:21 UTC 2013


#23605: esc_url() strips spaces instead of encoding them
-----------------------------+--------------------------
 Reporter:  johnbillion      |       Type:  defect (bug)
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  Formatting
  Version:                   |   Severity:  normal
 Keywords:                   |
-----------------------------+--------------------------
 If I pass a URL into `esc_url()` that contains a space, the space is
 stripped instead of encoded.

 To reproduce:

 {{{
 $url = 'http://example.com/foo bar/';

 echo '<pre>';
 var_dump( $url );
 var_dump( esc_url( $url ) );
 echo '</pre>';
 }}}

 The resulting URL ends up as `http://example.com/foobar/` instead of the
 expected `http://example.com/foo%20bar/`

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23605>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list