From 6fbe3c685dbb414703e2278a2950c03ca75d717b Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 9 Feb 2011 17:06:22 +0000 Subject: [PATCH] Return early if list is not an array. Props nacin. fixes #16499 for trunk git-svn-id: http://svn.automattic.com/wordpress/trunk@17427 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 39b7bb1cb..4da541005 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -3034,6 +3034,9 @@ function wp_array_slice_assoc( $array, $keys ) { * @return array A list of objects or object fields */ function wp_filter_object_list( $list, $args = array(), $operator = 'and', $field = false ) { + if ( ! is_array( $list ) ) + return array(); + $list = wp_list_filter( $list, $args, $operator ); if ( $field ) @@ -3057,6 +3060,9 @@ function wp_filter_object_list( $list, $args = array(), $operator = 'and', $fiel * @return array */ function wp_list_filter( $list, $args = array(), $operator = 'AND' ) { + if ( ! is_array( $list ) ) + return array(); + if ( empty( $args ) ) return $list;