Property changes on: wp-includes
___________________________________________________________________
Added: svn:ignore
+ .19922.patch.swp
|
|
|
419 | 419 | $cookies_header .= $cookie->getHeaderValue() . '; '; |
420 | 420 | } |
421 | 421 | $cookies_header = substr( $cookies_header, 0, -2 ); |
| 422 | $cookies_header = apply_filters( 'http_headers_cookie', $cookies_header ); |
422 | 423 | $r['headers']['cookie'] = $cookies_header; |
423 | 424 | } |
424 | 425 | } |
… |
… |
|
1540 | 1541 | if ( empty( $this->name ) || empty( $this->value ) ) |
1541 | 1542 | return ''; |
1542 | 1543 | |
1543 | | return $this->name . '=' . urlencode( $this->value ); |
| 1544 | return $this->name . '=' . $this->encodeString( $this->value ); |
1544 | 1545 | } |
| 1546 | |
| 1547 | /** |
| 1548 | * URL encode non-printable characters only |
| 1549 | * |
| 1550 | * @link http://stackoverflow.com/a/1969339 |
| 1551 | * |
| 1552 | * @param string $str |
| 1553 | * @return string |
| 1554 | */ |
| 1555 | public function encodeString( $str ) { |
| 1556 | $chars = preg_split( '//', $str, -1, PREG_SPLIT_NO_EMPTY ); |
| 1557 | return implode( '', array_map( array( $this, 'encodeChar' ), $chars ) ); |
| 1558 | } |
1545 | 1559 | |
| 1560 | /** |
| 1561 | * Encode only non-printable chars |
| 1562 | * @param string $char |
| 1563 | * @return string |
| 1564 | */ |
| 1565 | public function encodeChar( $char ) { |
| 1566 | if ( ctype_print( $char ) && !in_array( $char, array( ';', ' ', '%', '+' ) ) ) |
| 1567 | return $char; |
| 1568 | return rawurlencode( $char ); |
| 1569 | } |
| 1570 | |
1546 | 1571 | /** |
1547 | 1572 | * Retrieve cookie header for usage in the rest of the WordPress HTTP API. |
1548 | 1573 | * |