Changeset 38461 for branches/4.6
- Timestamp:
- 08/31/2016 06:06:34 AM (8 years ago)
- Location:
- branches/4.6
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.6
-
branches/4.6/src/wp-includes/class-http.php
r38173 r38461 434 434 if ( $value instanceof WP_Http_Cookie ) { 435 435 $cookie_jar[ $value->name ] = new Requests_Cookie( $value->name, $value->value, $value->get_attributes() ); 436 } elseif ( is_s tring( $value ) ) {436 } elseif ( is_scalar( $value ) ) { 437 437 $cookie_jar[ $name ] = new Requests_Cookie( $name, $value ); 438 438 } -
branches/4.6/tests/phpunit/tests/http/http.php
r36749 r38461 119 119 120 120 } 121 122 /** 123 * @ticket 37768 124 */ 125 public function test_normalize_cookies_scalar_values() { 126 $http = _wp_http_get_object(); 127 128 $cookies = array( 129 'x' => 'foo', 130 'y' => 2, 131 'z' => 0.45, 132 'foo' => array( 'bar' ), 133 ); 134 135 $cookie_jar = $http->normalize_cookies( array( 136 'x' => 'foo', 137 'y' => 2, 138 'z' => 0.45, 139 'foo' => array( 'bar' ), 140 ) ); 141 142 $this->assertInstanceOf( 'Requests_Cookie_Jar', $cookie_jar ); 143 144 foreach( array_keys( $cookies ) as $cookie ) { 145 if ( 'foo' === $cookie ) { 146 $this->assertFalse( isset( $cookie_jar[ $cookie ] ) ); 147 } else { 148 $this->assertInstanceOf( 'Requests_Cookie', $cookie_jar[ $cookie ] ); 149 } 150 } 151 } 121 152 }
Note: See TracChangeset
for help on using the changeset viewer.