Make WordPress Core

Opened 17 years ago

Closed 15 years ago

#6647 closed enhancement (fixed)

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

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

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 16 years ago.
6647.2.diff (13.5 KB) - added by Denis-de-Bernardy 15 years ago.
more_array_args.6647.diff (3.7 KB) - added by filosofo 15 years ago.
more_array_args.6647.2.diff (5.9 KB) - added by hakre 15 years ago.

Download all attachments as: .zip

Change History (19)

@DD32
16 years ago

#1 @DD32
16 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
16 years ago

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

#3 @ryan
16 years ago

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

#4 @Denis-de-Bernardy
15 years ago

  • Component changed from General to Optimization

fixed?

#5 @Denis-de-Bernardy
15 years ago

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

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

#6 @Denis-de-Bernardy
15 years ago

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

#7 @Denis-de-Bernardy
15 years ago

  • Keywords has-patch needs-testing added; needs-patch removed
  • Milestone changed from Future Release to 2.9

untested patch attached

#8 @Denis-de-Bernardy
15 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
15 years ago

  • Keywords early added
  • Milestone changed from 2.9 to 3.0

#10 @ryan
15 years ago

  • Keywords has-patch needs-testing early removed

Leaving open to catch any further ones.

#12 @filosofo
15 years ago

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

#13 @hakre
15 years ago

  • Keywords has-patch added
  • Version set to 2.9

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

#14 @Denis-de-Bernardy
15 years ago

  • Keywords commit added

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

#15 @westi
15 years ago

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

(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.