Changeset 25016 for trunk/src/wp-includes/class-http.php
- Timestamp:
- 08/08/2013 02:43:36 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-http.php
r24894 r25016 410 410 * Takes the arguments for a ::request() and checks for the cookie array. 411 411 * 412 * If it's found, then it 's assumed to contain WP_Http_Cookie objects, which are each parsed413 * into strings and added to the Cookie: header (within the arguments array). Edits the array by414 * reference.412 * If it's found, then it upgrades any basic name => value pairs to WP_Http_Cookie instances, 413 * which are each parsed into strings and added to the Cookie: header (within the arguments array). 414 * Edits the array by reference. 415 415 * 416 416 * @access public … … 422 422 public static function buildCookieHeader( &$r ) { 423 423 if ( ! empty($r['cookies']) ) { 424 // Upgrade any name => value cookie pairs to WP_HTTP_Cookie instances 425 foreach ( $r['cookies'] as $name => $value ) { 426 if ( ! is_object( $value ) ) 427 $r['cookies'][ $name ] = new WP_HTTP_Cookie( array( 'name' => $name, 'value' => $value ) ); 428 } 429 424 430 $cookies_header = ''; 425 431 foreach ( (array) $r['cookies'] as $cookie ) { 426 432 $cookies_header .= $cookie->getHeaderValue() . '; '; 427 433 } 434 428 435 $cookies_header = substr( $cookies_header, 0, -2 ); 429 436 $r['headers']['cookie'] = $cookies_header;
Note: See TracChangeset
for help on using the changeset viewer.