[wp-trac] [WordPress Trac] #17923: add_query_arg() should encode values

WordPress Trac wp-trac at lists.automattic.com
Fri Dec 9 01:17:21 UTC 2011


#17923: add_query_arg() should encode values
-----------------------------------+-----------------------------
 Reporter:  Viper007Bond           |       Owner:
     Type:  defect (bug)           |      Status:  new
 Priority:  normal                 |   Milestone:  Future Release
Component:  General                |     Version:  3.2
 Severity:  normal                 |  Resolution:
 Keywords:  needs-patch has-patch  |
-----------------------------------+-----------------------------

Comment (by Viper007Bond):

 Just noticed something else -- why the change in methods between the array
 vs strings?

 For arrays, you leave it where the value gets assigned to a variable and
 then check to see if encoding is enabled and if so, you then encode the
 value.

 However for strings, you do both at once.

 In short, wouldn't this be better?

 (first line already exists in core, second and third lines would be new)

 {{{
 $qs[func_get_arg( 0 )] = func_get_arg( 1 );
 if ( true === @func_get_arg( 3 ) )
         $qs[func_get_arg( 0 )] = rawurlencode( $qs[func_get_arg( 0 )] );
 }}}

 Wow, I am sure being nitpicky today. Sorry. lol

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


More information about the wp-trac mailing list