diff --git src/wp-includes/class-http.php src/wp-includes/class-http.php
index bead194..a72c396 100644
|
|
class WP_Http { |
440 | 440 | |
441 | 441 | foreach ( $cookies as $name => $value ) { |
442 | 442 | if ( $value instanceof WP_Http_Cookie ) { |
443 | | $cookie_jar[ $value->name ] = new Requests_Cookie( $value->name, $value->value, $value->get_attributes() ); |
| 443 | $cookie_jar[ $value->name ] = new Requests_Cookie( $value->name, $value->value, $value->get_attributes(), array( 'host-only' => $value->host_only ) ); |
444 | 444 | } elseif ( is_scalar( $value ) ) { |
445 | 445 | $cookie_jar[ $name ] = new Requests_Cookie( $name, $value ); |
446 | 446 | } |
diff --git src/wp-includes/class-wp-http-cookie.php src/wp-includes/class-wp-http-cookie.php
index 568fe48..3caf823 100644
|
|
class WP_Http_Cookie { |
61 | 61 | public $domain; |
62 | 62 | |
63 | 63 | /** |
| 64 | * host-only flag. |
| 65 | * |
| 66 | * @since trunk |
| 67 | * @var bool |
| 68 | */ |
| 69 | public $host_only; |
| 70 | |
| 71 | /** |
64 | 72 | * Sets up this cookie object. |
65 | 73 | * |
66 | 74 | * The parameter $data should be either an associative array containing the indices names below |
… |
… |
class WP_Http_Cookie { |
71 | 79 | * @param string|array $data { |
72 | 80 | * Raw cookie data as header string or data array. |
73 | 81 | * |
74 | | * @type string $name Cookie name. |
75 | | * @type mixed $value Value. Should NOT already be urlencoded. |
76 | | * @type string|int $expires Optional. Unix timestamp or formatted date. Default null. |
77 | | * @type string $path Optional. Path. Default '/'. |
78 | | * @type string $domain Optional. Domain. Default host of parsed $requested_url. |
79 | | * @type int $port Optional. Port. Default null. |
| 82 | * @type string $name Cookie name. |
| 83 | * @type mixed $value Value. Should NOT already be urlencoded. |
| 84 | * @type string|int $expires Optional. Unix timestamp or formatted date. Default null. |
| 85 | * @type string $path Optional. Path. Default '/'. |
| 86 | * @type string $domain Optional. Domain. Default host of parsed $requested_url. |
| 87 | * @type int $port Optional. Port. Default null. |
| 88 | * @type bool $host_only Optional. host-only storage flag. Default true. |
80 | 89 | * } |
81 | 90 | * @param string $requested_url The URL which the cookie was set on, used for default $domain |
82 | 91 | * and $port values. |
… |
… |
class WP_Http_Cookie { |
128 | 137 | } |
129 | 138 | |
130 | 139 | // Set properties based directly on parameters. |
131 | | foreach ( array( 'name', 'value', 'path', 'domain', 'port' ) as $field ) { |
| 140 | foreach ( array( 'name', 'value', 'path', 'domain', 'port', 'host_only' ) as $field ) { |
132 | 141 | if ( isset( $data[ $field ] ) ) { |
133 | 142 | $this->$field = $data[ $field ]; |
134 | 143 | } |
diff --git src/wp-includes/class-wp-http-requests-response.php src/wp-includes/class-wp-http-requests-response.php
index df0957f..b6c5f24 100644
|
|
class WP_HTTP_Requests_Response extends WP_HTTP_Response { |
164 | 164 | foreach ( $this->response->cookies as $cookie ) { |
165 | 165 | $cookies[] = new WP_Http_Cookie( |
166 | 166 | array( |
167 | | 'name' => $cookie->name, |
168 | | 'value' => urldecode( $cookie->value ), |
169 | | 'expires' => isset( $cookie->attributes['expires'] ) ? $cookie->attributes['expires'] : null, |
170 | | 'path' => isset( $cookie->attributes['path'] ) ? $cookie->attributes['path'] : null, |
171 | | 'domain' => isset( $cookie->attributes['domain'] ) ? $cookie->attributes['domain'] : null, |
| 167 | 'name' => $cookie->name, |
| 168 | 'value' => urldecode( $cookie->value ), |
| 169 | 'expires' => isset( $cookie->attributes['expires'] ) ? $cookie->attributes['expires'] : null, |
| 170 | 'path' => isset( $cookie->attributes['path'] ) ? $cookie->attributes['path'] : null, |
| 171 | 'domain' => isset( $cookie->attributes['domain'] ) ? $cookie->attributes['domain'] : null, |
| 172 | 'host_only' => isset( $cookie->flags['host-only'] ) ? $cookie->flags['host-only'] : null, |
172 | 173 | ) |
173 | 174 | ); |
174 | 175 | } |