Handle empty pairs in cookies. Props DD32. fixes #9101
git-svn-id: https://develop.svn.wordpress.org/trunk@10565 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
38845db326
commit
7822f3aad9
|
@ -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 )
|
||||
|
|
Loading…
Reference in New Issue