Changeset 38164 for trunk/src/wp-includes/class-http.php
- Timestamp:
- 07/27/2016 03:31:48 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-http.php
r38054 r38164 326 326 } 327 327 328 // If we've got cookies, use them328 // If we've got cookies, use and convert them to Requests_Cookie. 329 329 if ( ! empty( $r['cookies'] ) ) { 330 $options['cookies'] = $r['cookies'];330 $options['cookies'] = WP_Http::normalize_cookies( $r['cookies'] ); 331 331 } 332 332 … … 415 415 416 416 /** 417 * Normalizes cookies for using in Requests. 418 * 419 * @since 4.6.0 420 * @access public 421 * @static 422 * 423 * @param array $cookies List of cookies to send with the request. 424 * @return Requests_Cookie_Jar Cookie holder object. 425 */ 426 public static function normalize_cookies( $cookies ) { 427 $cookie_jar = new Requests_Cookie_Jar(); 428 429 foreach ( $cookies as $name => $value ) { 430 if ( $value instanceof WP_Http_Cookie ) { 431 $cookie_jar[ $value->name ] = new Requests_Cookie( $value->name, $value->value, $value->get_attributes() ); 432 } elseif ( is_string( $value ) ) { 433 $cookie_jar[ $name ] = new Requests_Cookie( $name, $value ); 434 } 435 } 436 437 return $cookie_jar; 438 } 439 440 /** 417 441 * Match redirect behaviour to browser handling. 418 442 * … … 421 445 * specification for compatibility purposes. 422 446 * 423 * @param string $location URL to redirect to. 424 * @param array $headers Headers for the redirect. 425 * @param array $options Redirect request options. 447 * @since 4.6.0 448 * @access public 449 * @static 450 * 451 * @param string $location URL to redirect to. 452 * @param array $headers Headers for the redirect. 453 * @param array $options Redirect request options. 426 454 * @param Requests_Response $original Response object. 427 455 */
Note: See TracChangeset
for help on using the changeset viewer.