HTTP: Add support for the host-only flag to Wp_Http_Cookie.

Props soulseekah.
Fixes #43231.


git-svn-id: https://develop.svn.wordpress.org/trunk@45135 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast
2019-04-08 05:31:35 +00:00
parent 11e97aae1e
commit 3652d05fcf
4 changed files with 49 additions and 13 deletions

View File

@@ -449,7 +449,7 @@ class WP_Http {
foreach ( $cookies as $name => $value ) {
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(), array( 'host-only' => $value->host_only ) );
} elseif ( is_scalar( $value ) ) {
$cookie_jar[ $name ] = new Requests_Cookie( $name, $value );
}