mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-24 21:32:51 +02:00
WP_HTTP: Make the new 2nd parameter to WP_HTP::processHeaders() as optional. See #21182. Fixes #25179
Built from https://develop.svn.wordpress.org/trunk@25176 git-svn-id: http://core.svn.wordpress.org/trunk@25149 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
cf02025fe0
commit
994033258e
@ -371,7 +371,7 @@ class WP_Http {
|
|||||||
* @return array Processed string headers. If duplicate headers are encountered,
|
* @return array Processed string headers. If duplicate headers are encountered,
|
||||||
* Then a numbered array is returned as the value of that header-key.
|
* Then a numbered array is returned as the value of that header-key.
|
||||||
*/
|
*/
|
||||||
public static function processHeaders( $headers, $url ) {
|
public static function processHeaders( $headers, $url = '' ) {
|
||||||
// split headers, one per array element
|
// split headers, one per array element
|
||||||
if ( is_string($headers) ) {
|
if ( is_string($headers) ) {
|
||||||
// tolerate line terminator: CRLF = LF (RFC 2616 19.3)
|
// tolerate line terminator: CRLF = LF (RFC 2616 19.3)
|
||||||
@ -1708,6 +1708,7 @@ class WP_Http_Cookie {
|
|||||||
* @param string $requested_url The URL which the cookie was set on, used for default 'domain' and 'port' values
|
* @param string $requested_url The URL which the cookie was set on, used for default 'domain' and 'port' values
|
||||||
*/
|
*/
|
||||||
function __construct( $data, $requested_url = '' ) {
|
function __construct( $data, $requested_url = '' ) {
|
||||||
|
if ( $requested_url )
|
||||||
$arrURL = @parse_url( $requested_url );
|
$arrURL = @parse_url( $requested_url );
|
||||||
if ( isset( $arrURL['host'] ) )
|
if ( isset( $arrURL['host'] ) )
|
||||||
$this->domain = $arrURL['host'];
|
$this->domain = $arrURL['host'];
|
||||||
|
Loading…
Reference in New Issue
Block a user