Scanning all of core and all the extensions we have in svn, it doesn't look like anyone makes any calls to Interwiki::getURL using the argument so this should be safe enough to clean up the api.
Also update Title::getFullURL to make use of the first arg now.
$url = $wgServer . $url;
}
} else {
- $baseUrl = $interwiki->getURL();
-
- $namespace = wfUrlencode( $this->getNsText() );
+ $namespace = $this->getNsText();
if ( $namespace != '' ) {
# Can this actually happen? Interwikis shouldn't be parsed.
# Yes! It can in interwiki transclusion. But... it probably shouldn't.
$namespace .= ':';
}
- $url = str_replace( '$1', $namespace . $this->mUrlform, $baseUrl );
+ $url = $interwiki->getURL( $namespace . $this->getDBkey() );
$url = wfAppendQuery( $url, $query );
}
*
* @param $title String: what text to put for the article name
* @return String: the URL
+ * @note Prior to 1.19 getURL did not urlencode the $title, if you use this
+ * arg in an extension that supports MW earlier than 1.19 please ensure
+ * you wfUrlencode it when installed in earlier versions of MW.
*/
public function getURL( $title = null ) {
$url = $this->mURL;
if( $title != null ) {
- $url = str_replace( "$1", $title, $url );
+ $url = str_replace( "$1", wfUrlencode( $title ), $url );
}
return $url;
}