// 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
- // 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 ) );
+ $url = preg_replace( '/title=[^&]*&/', '', $titleObj->getInternalURL( $url ) );
}
if( isset( $this->mExtra['oldSize'] ) && isset( $this->mExtra['newSize'] ) ) {
* Get the URL form for an internal link.
* - Used in various Squid-related code, in case we have a different
* internal hostname for the server from the exposed one.
+ *
+ * This uses $wgInternalServer to qualify the path, or $wgServer
+ * if $wgInternalServer is not set. If the server variable used is
+ * protocol-relative, the URL will be expanded to http://
*
* @param $query String an optional query string
* @param $variant String language variant of url (for sr, zh..)
public function getInternalURL( $query = '', $variant = false ) {
global $wgInternalServer, $wgServer;
$server = $wgInternalServer !== false ? $wgInternalServer : $wgServer;
- $url = $server . $this->getLocalURL( $query, $variant );
+ $url = wfExpandUrl( $server . $this->getLocalURL( $query, $variant ), PROTO_HTTP );
wfRunHooks( 'GetInternalURL', array( &$this, &$url, $query ) );
return $url;
}