wp/wp-includes/class-wp-http-requests-response.php
changeset 9 177826044cd9
parent 7 cf61fcea0001
child 16 a86126ab1dd4
--- a/wp/wp-includes/class-wp-http-requests-response.php	Mon Oct 14 18:06:33 2019 +0200
+++ b/wp/wp-includes/class-wp-http-requests-response.php	Mon Oct 14 18:28:13 2019 +0200
@@ -162,13 +162,16 @@
 	public function get_cookies() {
 		$cookies = array();
 		foreach ( $this->response->cookies as $cookie ) {
-			$cookies[] = new WP_Http_Cookie( array(
-				'name'    => $cookie->name,
-				'value'   => urldecode( $cookie->value ),
-				'expires' => isset( $cookie->attributes['expires'] ) ? $cookie->attributes['expires'] : null,
-				'path'    => isset( $cookie->attributes['path'] ) ? $cookie->attributes['path'] : null,
-				'domain'  => isset( $cookie->attributes['domain'] ) ? $cookie->attributes['domain'] : null,
-			));
+			$cookies[] = new WP_Http_Cookie(
+				array(
+					'name'      => $cookie->name,
+					'value'     => urldecode( $cookie->value ),
+					'expires'   => isset( $cookie->attributes['expires'] ) ? $cookie->attributes['expires'] : null,
+					'path'      => isset( $cookie->attributes['path'] ) ? $cookie->attributes['path'] : null,
+					'domain'    => isset( $cookie->attributes['domain'] ) ? $cookie->attributes['domain'] : null,
+					'host_only' => isset( $cookie->flags['host-only'] ) ? $cookie->flags['host-only'] : null,
+				)
+			);
 		}
 
 		return $cookies;
@@ -183,13 +186,13 @@
 	 */
 	public function to_array() {
 		return array(
-			'headers' => $this->get_headers(),
-			'body' => $this->get_data(),
+			'headers'  => $this->get_headers(),
+			'body'     => $this->get_data(),
 			'response' => array(
 				'code'    => $this->get_status(),
 				'message' => get_status_header_desc( $this->get_status() ),
 			),
-			'cookies' => $this->get_cookies(),
+			'cookies'  => $this->get_cookies(),
 			'filename' => $this->filename,
 		);
 	}