[wp-trac] [WordPress Trac] #17052: wp_sanitize_redirect() removes square brackets from URL

WordPress Trac wp-trac at lists.automattic.com
Tue Apr 5 07:12:17 UTC 2011


#17052: wp_sanitize_redirect() removes square brackets from URL
--------------------------+-----------------------------
 Reporter:  bluntelk      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  3.1
 Severity:  minor         |   Keywords:  has-patch
--------------------------+-----------------------------
 The function wp_sanitize_redirect() removes square brackets from URLs.

 PHP's functionality with arrays in the URL require square braces,
 stripping them from the URL means that pages (and plugins) that rely on
 them fail.

 To Reproduce:

 {{{
 <?php
 $url = 'http://example.com/my_url_array[1]=hello+world';
 print wp_sanitize_redirect($url);
 ?>
 }}}


 Current Output:
 http://example.com/my_url_array1=hello+world

 Expected Output:
 http://example.com/my_url_array[1]=hello+world

 Whilst developers should be able to work around this as the function is
 pluggable I believe this should just work out of the box.

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


More information about the wp-trac mailing list