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:
Dion Hulse 2013-08-30 02:11:09 +00:00
parent cf02025fe0
commit 994033258e

View File

@ -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'] : '/';