HTTP: Accept non-string values in cookies, fixing a regression since 4.5.

Props swissspidy.
Merges [38430] to the 4.6 branch.
Fixes #37768.

Built from https://develop.svn.wordpress.org/branches/4.6@38461


git-svn-id: http://core.svn.wordpress.org/branches/4.6@38402 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dion Hulse 2016-08-31 06:07:31 +00:00
parent c53ae0299a
commit 6ddc8affb1
2 changed files with 2 additions and 2 deletions

View File

@ -433,7 +433,7 @@ class WP_Http {
foreach ( $cookies as $name => $value ) { foreach ( $cookies as $name => $value ) {
if ( $value instanceof WP_Http_Cookie ) { if ( $value instanceof WP_Http_Cookie ) {
$cookie_jar[ $value->name ] = new Requests_Cookie( $value->name, $value->value, $value->get_attributes() ); $cookie_jar[ $value->name ] = new Requests_Cookie( $value->name, $value->value, $value->get_attributes() );
} elseif ( is_string( $value ) ) { } elseif ( is_scalar( $value ) ) {
$cookie_jar[ $name ] = new Requests_Cookie( $name, $value ); $cookie_jar[ $name ] = new Requests_Cookie( $name, $value );
} }
} }

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.6.1-alpha-38460'; $wp_version = '4.6.1-alpha-38461';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.