http://www.mediawiki.org/wiki/Special:Code/MediaWiki/96562
Revision: 96562
Author: catrope
Date: 2011-09-08 13:48:11 +0000 (Thu, 08 Sep 2011)
Log Message:
-----------
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)
Modified Paths:
--------------
trunk/phase3/includes/HttpFunctions.php
Modified: trunk/phase3/includes/HttpFunctions.php
===================================================================
--- trunk/phase3/includes/HttpFunctions.php 2011-09-08 13:02:20 UTC (rev
96561)
+++ trunk/phase3/includes/HttpFunctions.php 2011-09-08 13:48:11 UTC (rev
96562)
@@ -32,7 +32,6 @@
* @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 @@
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' );
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs