Handle empty pairs in cookies. Props DD32. fixes #9101
git-svn-id: http://svn.automattic.com/wordpress/trunk@10565 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e18f062b92
commit
4c5da3c279
|
@ -1375,10 +1375,12 @@ class WP_Http_Cookie {
|
||||||
$value = substr( $pairs[0], strpos( $pairs[0], '=' ) + 1 );
|
$value = substr( $pairs[0], strpos( $pairs[0], '=' ) + 1 );
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
$this->value = urldecode( $value );
|
$this->value = urldecode( $value );
|
||||||
array_shift( $pairs );
|
array_shift( $pairs ); //Removes name=value from items.
|
||||||
|
|
||||||
// Set everything else as a property
|
// Set everything else as a property
|
||||||
foreach ( $pairs as $pair ) {
|
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 );
|
list( $key, $val ) = explode( '=', $pair );
|
||||||
$key = strtolower( trim( $key ) );
|
$key = strtolower( trim( $key ) );
|
||||||
if ( 'expires' == $key )
|
if ( 'expires' == $key )
|
||||||
|
|
Loading…
Reference in New Issue