WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 15 months ago

#4903 closed defect (bug) (fixed)

query strings with a forward slash give add_query_arg() problems

Reported by: markjaquith Owned by: 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)

comment:1 markjaquith7 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

comment:2 markjaquith7 years ago

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

comment:3 nacin15 months 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.