WordPress.org

Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#16499 closed defect (bug) (fixed)

wp_list_filter() no longer watches for $list to be an array

Reported by: nacin Owned by:
Milestone: 3.1 Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch commit
Focuses: Cc:

Description

In 3.0, wp_filter_object_list() returned early if $list was not an array.

Now the call gets passed right to wp_list_filter(), which no longer does the check.

Seen in the wild at http://wordpress.org/support/topic/wordpress-31-rc4-warning-invalid-argument-supplied-for-foreach?replies=3.

Can probably just patch wp_filter_object_list() rather than the new wp_list_filter().

Attachments (2)

16499.diff (489 bytes) - added by nacin 11 years ago.
16499.2.diff (699 bytes) - added by nacin 11 years ago.
Checks in both spots.

Download all attachments as: .zip

Change History (11)

@nacin
11 years ago

#1 @nacin
11 years ago

  • Keywords has-patch added; needs-patch removed

Patch handles the issue higher up the stack, where the check was originally.

#2 @scribu
11 years ago

Why not handle it lower down?

#3 @scribu
11 years ago

  • Severity changed from normal to minor

#4 @nacin
11 years ago

I just feel like fixing the regression. No need to hand-hold regarding arrays if wp_list_filter() requires an array.

#5 @nacin
11 years ago

  • Severity changed from minor to normal

No, it's not minor. It's a regression that generates errors of E_WARNING.

#6 @scribu
11 years ago

  • Keywords commit added

Ok, fine.

@nacin
11 years ago

Checks in both spots.

#7 @nacin
11 years ago

New patch per IRC. Second checks can't hurt.

#8 @ryan
11 years ago

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

(In [17427]) Return early if list is not an array. Props nacin. fixes #16499 for trunk

#9 @ryan
11 years ago

(In [17428]) Return early if list is not an array. Props nacin. fixes #16499 for 3.1

Note: See TracTickets for help on using tickets.