$this->mOutput->addLanguageLink( $nt->getFullText() );
}
- /**
- * Strip the whitespace interwiki links produce, see T10897
- */
$s = rtrim( $s . $prefix );
- $s .= rtrim( $trail, "\n" );
+ $s .= trim( $trail, "\n" ) == '' ? '' : $prefix . $trail;
continue;
}
continue;
}
} elseif ( $ns == NS_CATEGORY ) {
- /**
- * Strip the whitespace Category links produce, see T2087
- */
- $s = rtrim( $s . $prefix ); # T2087, T87753
- $s .= rtrim( $trail, "\n" );
+ $s = rtrim( $s . "\n" ); # T2087
if ( $wasblank ) {
$sortkey = $this->getDefaultSort();
$sortkey = $this->getConverterLanguage()->convertCategoryKey( $sortkey );
$this->mOutput->addCategory( $nt->getDBkey(), $sortkey );
+ /**
+ * Strip the whitespace Category links produce, see T2087
+ */
+ $s .= trim( $prefix . $trail, "\n" ) == '' ? '' : $prefix . $trail;
+
continue;
}
}
) ) );
break;
case 'talkpagename':
- if ( $this->mTitle->canTalk() ) {
+ if ( $this->mTitle->canHaveTalkPage() ) {
$talkPage = $this->mTitle->getTalkPage();
$value = wfEscapeWikiText( $talkPage->getPrefixedText() );
} else {
}
break;
case 'talkpagenamee':
- if ( $this->mTitle->canTalk() ) {
+ if ( $this->mTitle->canHaveTalkPage() ) {
$talkPage = $this->mTitle->getTalkPage();
$value = wfEscapeWikiText( $talkPage->getPrefixedURL() );
} else {
$value = $this->mTitle->getNamespace();
break;
case 'talkspace':
- $value = $this->mTitle->canTalk()
+ $value = $this->mTitle->canHaveTalkPage()
? str_replace( '_', ' ', $this->mTitle->getTalkNsText() )
: '';
break;
case 'talkspacee':
- $value = $this->mTitle->canTalk() ? wfUrlencode( $this->mTitle->getTalkNsText() ) : '';
+ $value = $this->mTitle->canHaveTalkPage() ? wfUrlencode( $this->mTitle->getTalkNsText() ) : '';
break;
case 'subjectspace':
$value = str_replace( '_', ' ', $this->mTitle->getSubjectNsText() );