(bug 30398) Expand any protocol-relative URLs to HTTP in RecentChange::getIRCLine...
authorRoan Kattouw <catrope@users.mediawiki.org>
Wed, 17 Aug 2011 13:32:45 +0000 (13:32 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Wed, 17 Aug 2011 13:32:45 +0000 (13:32 +0000)
includes/RecentChange.php

index 2819ce6..518444d 100644 (file)
@@ -705,7 +705,9 @@ class RecentChange {
                        // XXX: *HACK^2* the preg_replace() undoes much of what getInternalURL() does, but we 
                        // XXX: need to call it so that URL paths on the Wikimedia secure server can be fixed
                        // XXX: by a custom GetInternalURL hook --vyznev 2008-12-10
-                       $url = preg_replace( '/title=[^&]*&/', '', $titleObj->getInternalURL( $url ) );
+                       // XXX: Also, getInternalUrl() may return a protocol-relative URL.
+                       // XXX: In that case, expand it to an HTTP URL, even if this is an HTTPS request --catrope 2011-08-17
+                       $url = preg_replace( '/title=[^&]*&/', '', wfExpandUrl( $titleObj->getInternalURL( $url ), PROTO_HTTP ) );
                }
 
                if( isset( $this->mExtra['oldSize'] ) && isset( $this->mExtra['newSize'] ) ) {