Make WordPress Core

Opened 17 years ago

Closed 17 years ago

Last modified 12 years ago

#4903 closed defect (bug) (fixed)

query strings with a forward slash give add_query_arg() problems

Reported by: markjaquith's profile markjaquith Owned by: markjaquith's profile markjaquith
Milestone: 2.3 Priority: high
Severity: normal Version: 2.3
Component: General Keywords:
Focuses: Cc:

Description

echo remove_query_arg('preview', 'p=16&preview=true/');

Expected result:

p=16

Actual result:

p=16&preview=true/

add_query_arg() is checking for a forward slash in the passed $uri. If present, it is assumed that $uri is a base with an empty query string, instead of being a pure query string.

Change History (3)

#1 @markjaquith
17 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [6030]) Require a slash AND the absence of an equals sign to designate the passed $uri as a base (without a query string). fixes #4903 for trunk

#2 @markjaquith
17 years ago

(In [6031]) Actually, let's just drop that slash check altogether. Equals sign is the best indicator. fixes #4903 for trunk

#3 @nacin
12 years ago

In 1192/tests:

Test add_query_arg() when used with only a query string. see #4903. see #23284.

Note: See TracTickets for help on using tickets.