Make WordPress Core

Changeset 18606


Ignore:
Timestamp:
08/25/2011 07:50:29 PM (13 years ago)
Author:
ryan
Message:

Properly handle nested arrays in wp_list_filter(). Props scribu, SergeyBiryukov. fixes #16137

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r18602 r18606  
    31993199
    32003200    foreach ( $list as $key => $obj ) {
    3201         $matched = count( array_intersect_assoc( (array) $obj, $args ) );
     3201        $to_match = (array) $obj;
     3202
     3203        $matched = 0;
     3204        foreach ( $args as $m_key => $m_value ) {
     3205            if ( $m_value == $to_match[ $m_key ] )
     3206                $matched++;
     3207        }
     3208
    32023209        if ( ( 'AND' == $operator && $matched == $count )
    32033210          || ( 'OR' == $operator && $matched <= $count )
Note: See TracChangeset for help on using the changeset viewer.