From 34c74ee8ce4fdeb3dd5d611a612ea7975faeb0a6 Mon Sep 17 00:00:00 2001 From: nacin Date: Fri, 29 Jun 2012 19:42:27 +0000 Subject: [PATCH] Check if array key exists in wp_list_filter(). props wpsmith. fixes #20929. git-svn-id: http://core.svn.wordpress.org/trunk@21184 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 2e8752bccf..7f0fd23214 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -2402,7 +2402,7 @@ function wp_list_filter( $list, $args = array(), $operator = 'AND' ) { $matched = 0; foreach ( $args as $m_key => $m_value ) { - if ( $m_value == $to_match[ $m_key ] ) + if ( array_key_exists( $m_key, $to_match ) && $m_value == $to_match[ $m_key ] ) $matched++; }