[wp-trac] [WordPress Trac] #4465: add_query_arg() uses REQUEST_URI when it is undesirable to do so

WordPress Trac wp-trac at lists.automattic.com
Thu Jun 14 05:10:51 GMT 2007


#4465: add_query_arg() uses REQUEST_URI when it is undesirable to do so
-------------------------+--------------------------------------------------
 Reporter:  markjaquith  |       Owner:  anonymous
     Type:  defect       |      Status:  new      
 Priority:  normal       |   Milestone:  2.2.1    
Component:  General      |     Version:  2.2      
 Severity:  normal       |    Keywords:           
-------------------------+--------------------------------------------------
 mod_rewrite permalinks, blog URL as domain root.

 from http://example.com/page/2/

 code:

 {{{
 echo remove_query_arg('arbitrary', '');
 }}}

 expected result is a blank string (remove a query arg from a blank string,
 you should get that same blank string back).

 actual result:

 {{{
 /page/2/
 }}}

 It's using the REQUEST URI because it thinks you haven't provided your own
 query string.  But you have... it's just blank.  {{{add_query_arg()}}} and
 {{{remove_query_arg()}}} need to use something other than a blank string
 to designate that the user has neglected to provide their own QS.

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


More information about the wp-trac mailing list