From e9a8ae1acf69741111da50773d938b01f282497c Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Fri, 30 Aug 2013 02:10:34 +0000 Subject: [PATCH] WP_HTTP: Make the new 2nd parameter to WP_HTP::processHeaders() as optional. See #21182. Fixes #25179 git-svn-id: https://develop.svn.wordpress.org/trunk@25176 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-http.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/class-http.php b/src/wp-includes/class-http.php index 6dc6fbe225..c38434b690 100644 --- a/src/wp-includes/class-http.php +++ b/src/wp-includes/class-http.php @@ -371,7 +371,7 @@ class WP_Http { * @return array Processed string headers. If duplicate headers are encountered, * 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 if ( is_string($headers) ) { // tolerate line terminator: CRLF = LF (RFC 2616 19.3) @@ -1708,7 +1708,8 @@ class WP_Http_Cookie { * @param string $requested_url The URL which the cookie was set on, used for default 'domain' and 'port' values */ function __construct( $data, $requested_url = '' ) { - $arrURL = @parse_url( $requested_url ); + if ( $requested_url ) + $arrURL = @parse_url( $requested_url ); if ( isset( $arrURL['host'] ) ) $this->domain = $arrURL['host']; $this->path = isset( $arrURL['path'] ) ? $arrURL['path'] : '/';