$iw = $nt->getInterWiki();
if( $noforce ) {
if( $iw && $this->mOptions->getInterwikiMagic() && $nottalk && $wgLang->getLanguageName( $iw ) ) {
- array_push( $this->mOutput->mLanguageLinks, $nt->getPrefixedText() );
+ array_push( $this->mOutput->mLanguageLinks, $nt->getFullText() );
$tmp = $prefix . $trail ;
$s .= (trim($tmp) == '')? '': $tmp;
continue;
}
return $this->mPrefixedText;
}
+
+ # As getPrefixedText(), plus fragment.
+ function getFullText() {
+ $text = $this->getPrefixedText();
+ if( '' != $this->mFragment ) {
+ $text .= '#' . $this->mFragment;
+ }
+ return $text;
+ }
# Get a URL-encoded title (not an actual URL) including interwiki
function getPrefixedURL()
if ( "" == $this->mInterwiki ) {
$p = $wgArticlePath;
return $wgServer . $this->getLocalUrl( $query );
+ } else {
+ $baseUrl = $this->getInterwikiLink( $this->mInterwiki );
+ $namespace = $wgLang->getNsText( $this->mNamespace );
+ if ( "" != $namespace ) {
+ # Can this actually happen? Interwikis shouldn't be parsed.
+ $namepace .= ":";
+ }
+ $url = str_replace( "$1", $namespace . $this->mUrlform, $baseUrl );
+ if ( '' != $this->mFragment ) {
+ $url .= '#' . $this->mFragment;
+ }
+ return $url;
}
-
- $p = $this->getInterwikiLink( $this->mInterwiki );
- $n = $wgLang->getNsText( $this->mNamespace );
- if ( "" != $n ) { $n .= ":"; }
- $u = str_replace( "$1", $n . $this->mUrlform, $p );
- return $u;
}
# Get a URL with an optional query string, no fragment
# Initial capital letter
if( $wgCapitalLinks && $this->mInterwiki == "") {
$t = $wgLang->ucfirst( $r );
+ } else {
+ $t = $r;
}
# Fill fields