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
This commit is contained in:
Dion Hulse 2013-08-30 02:10:34 +00:00
parent 94e03ce09f
commit e9a8ae1acf
1 changed files with 3 additions and 2 deletions

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