Make WordPress Core

Opened 18 years ago

Closed 17 years ago

#6647 closed enhancement (fixed)

Internally, pass arrays instead of query strings to functions that use wp_parse_args()

Reported by: ryan Owned by:
Priority: normal Milestone: 3.0
Component: Optimization Version: 2.9
Severity: normal Keywords: has-patch commit
Cc: Focuses:

Description

Within core WP, we should pass arrays instead of query strings to functions that pass their args through wp_parse_args(). Arrays are faster, more secure, and avoid quoting bugs. See [7625] for an example conversion from a query string to an array.

Attachments (4)

6647.diff (2.6 KB ) - added by DD32 18 years ago.
6647.2.diff (13.5 KB ) - added by Denis-de-Bernardy 17 years ago.
more_array_args.6647.diff (3.7 KB ) - added by filosofo 17 years ago.
more_array_args.6647.2.diff (5.9 KB ) - added by hakre 17 years ago.

Download all attachments as: .zip

Change History (19)

@DD32
18 years ago

#1 @DD32
18 years ago

attachment 6647.diff added.

Just some that i came accross while creating a patch for #6772, The changes in wp-includes/media.php have been duplicated in a patch on that ticket. I'll refresh this patch if need be when that tickets fixed.

#2 @ryan
18 years ago

(In [7894]) Use array calling style. Props DD32. see #6647

#3 @ryan
18 years ago

(In [7911]) Use array calling style. see #6647

#4 @Denis-de-Bernardy
17 years ago

  • Component GeneralOptimization

fixed?

#5 @Denis-de-Bernardy
17 years ago

  • Keywords needs-patch added
  • Milestone 2.9Future Release
  • Type defect (bug)enhancement

there are still a few in the default theme. do we want them fixed?

#6 @Denis-de-Bernardy
17 years ago

get_bookmarks(), get_categories(), get_terms(), wp_get_object_terms() each have a few more

#7 @Denis-de-Bernardy
17 years ago

  • Keywords has-patch needs-testing added; needs-patch removed
  • Milestone Future Release2.9

untested patch attached

#8 @Denis-de-Bernardy
17 years ago

wp() might also need to be looked into:

wp("post_type=post&$post_status_q&posts_per_page=$posts_per_page&order=$order&orderby=$orderby");

#9 @ryan
17 years ago

  • Keywords early added
  • Milestone 2.93.0

#10 @ryan
17 years ago

  • Keywords has-patch needs-testing early removed

Leaving open to catch any further ones.

#12 @filosofo
17 years ago

Here are a few more that turned up in a grep.

#13 @hakre
17 years ago

  • Keywords has-patch added
  • Version2.9

I jumped in as well and found some more. Merged that together with filosofo's findings.

#14 @Denis-de-Bernardy
17 years ago

  • Keywords commit added

patch still applies clean. could we get this checked in?

#15 @westi
17 years ago

  • Resolutionfixed
  • Status newclosed

(In [12657]) Switch to passing arrays instead of query strings to functions. Fixes #6647 props filosofo and hakre.

Note: See TracTickets for help on using tickets.