Make WordPress Core

Opened 20 years ago

Closed 20 years ago

#2777 closed defect (bug) (fixed)

query_string_array filter

Reported by: markjaquith Owned by:
Priority: normal Milestone: 2.1
Component: Administration Version: 2.1
Severity: normal Keywords: hook filter
Cc: Focuses:

Description

Right now, you can filter the query string, but it is passed, well, as a query string. So to do anything useful, you have to use parse_str(), and then get it back to its original form when you are done. How about a hook that extracts it all into an array first?

Check out the attached patch.

Attachments (1)

query_string_array.diff (628 bytes ) - added by markjaquith 20 years ago.
Patch for /trunk/

Download all attachments as: .zip

Change History (3)

@markjaquith
20 years ago

Patch for /trunk/

#1 @ryanscheuermann
20 years ago

+1 - Instead of parsing and then recreating again, why not have build_query_string create an array first (in the foreachs), filter that array, then create the query string from the filtered array? That way you can ensure the filtered query string is rawurlencoded (in case the plugin writer forgets or is unaware).

#2 @ryan
20 years ago

  • Resolutionfixed
  • Status newclosed

(In [4129]) Deprecate query_string. Add 'request' filter to filter the array of query vars. Pass around arrays instead of query strings. fixes #2777

Note: See TracTickets for help on using tickets.