From: Roan Kattouw Date: Thu, 8 Sep 2011 13:48:11 +0000 (+0000) Subject: Move URL expansion from Http::request() (where it was put in r93820) to MWHttpRequest... X-Git-Tag: 1.31.0-rc.0~27797 X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=commitdiff_plain;h=37e3f5dff583300059f4a1c527dc765f63b1d417;p=lhc%2Fweb%2Fwiklou.git Move URL expansion from Http::request() (where it was put in r93820) to MWHttpRequest::__construct(). That should fix bug 30797 (UploadStash barfs on protocol-relative URLs) --- diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php index 33c2916ca5..20186f5105 100644 --- a/includes/HttpFunctions.php +++ b/includes/HttpFunctions.php @@ -32,7 +32,6 @@ class Http { * @return Mixed: (bool)false on failure or a string on success */ public static function request( $method, $url, $options = array() ) { - $url = wfExpandUrl( $url, PROTO_HTTP ); wfDebug( "HTTP: $method: $url\n" ); $options['method'] = strtoupper( $method ); @@ -178,14 +177,14 @@ class MWHttpRequest { public $status; /** - * @param $url String: url to use + * @param $url String: url to use. If protocol-relative, will be expanded to an http:// URL * @param $options Array: (optional) extra params to pass (see Http::request()) */ function __construct( $url, $options = array() ) { global $wgHTTPTimeout; - $this->url = $url; - $this->parsedUrl = parse_url( $url ); + $this->url = wfExpandUrl( $url, PROTO_HTTP ); + $this->parsedUrl = parse_url( $this->url ); if ( !Http::isValidURI( $this->url ) ) { $this->status = Status::newFatal( 'http-invalid-url' );