From 4876fc43d67ea44791dc7a37bcef9913bfa2db45 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Wed, 17 Aug 2011 13:32:45 +0000 Subject: [PATCH] (bug 30398) Expand any protocol-relative URLs to HTTP in RecentChange::getIRCLine(). This will prevent sending protocol-relative URLs to the IRC feed --- includes/RecentChange.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/RecentChange.php b/includes/RecentChange.php index 2819ce6c3e..518444d025 100644 --- a/includes/RecentChange.php +++ b/includes/RecentChange.php @@ -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'] ) ) { -- 2.20.1