From 4c5da3c279a4c2b96ac2a709ad3e782444b57d40 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 12 Feb 2009 20:44:34 +0000 Subject: [PATCH] Handle empty pairs in cookies. Props DD32. fixes #9101 git-svn-id: http://svn.automattic.com/wordpress/trunk@10565 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/http.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/http.php b/wp-includes/http.php index acb497dea5..86bd1790e7 100644 --- a/wp-includes/http.php +++ b/wp-includes/http.php @@ -1375,10 +1375,12 @@ class WP_Http_Cookie { $value = substr( $pairs[0], strpos( $pairs[0], '=' ) + 1 ); $this->name = $name; $this->value = urldecode( $value ); - array_shift( $pairs ); + array_shift( $pairs ); //Removes name=value from items. // Set everything else as a property foreach ( $pairs as $pair ) { + if ( empty($pair) ) //Handles the cookie ending in ; which results in a empty final pair + continue; list( $key, $val ) = explode( '=', $pair ); $key = strtolower( trim( $key ) ); if ( 'expires' == $key )