From 6ccd5c2540085034b5810fc1c58944d5ddc5264e Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Mon, 23 Feb 2009 21:55:49 +0000 Subject: [PATCH] Better Notice fixing and place a protective cast in the cookie handler. Fixes #9068 props filosofo. git-svn-id: https://develop.svn.wordpress.org/trunk@10639 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/http.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/http.php b/wp-includes/http.php index 61779225d7..7daaecfd39 100644 --- a/wp-includes/http.php +++ b/wp-includes/http.php @@ -578,9 +578,9 @@ class WP_Http { * @param array $r Full array of args passed into ::request() */ function buildCookieHeader( &$r ) { - if ( isset($r['cookies']) && count( $r['cookies'] ) ) { + if ( ! empty($r['cookies']) ) { $cookies_header = ''; - foreach ( $r['cookies'] as $cookie ) { + foreach ( (array) $r['cookies'] as $cookie ) { $cookies_header .= $cookie->getHeaderValue() . '; '; } $cookies_header = substr( $cookies_header, 0, -2 );