if ( !$toTitle || $toTitle->isExternal() ) {
$this->dieWithError( [ 'apierror-invalidtitle', wfEscapeWikiText( $params['to'] ) ] );
}
- $toTalk = $toTitle->canTalk() ? $toTitle->getTalkPage() : null;
+ $toTalk = $toTitle->getTalkPageIfDefined();
if ( $toTitle->getNamespace() == NS_FILE
&& !RepoGroup::singleton()->getLocalRepo()->findFile( $toTitle )
}
public static function talkspace( $parser, $title = null ) {
$t = Title::newFromText( $title );
- if ( is_null( $t ) || !$t->canTalk() ) {
+ if ( is_null( $t ) || !$t->canHaveTalkPage() ) {
return '';
}
return str_replace( '_', ' ', $t->getTalkNsText() );
}
public static function talkspacee( $parser, $title = null ) {
$t = Title::newFromText( $title );
- if ( is_null( $t ) || !$t->canTalk() ) {
+ if ( is_null( $t ) || !$t->canHaveTalkPage() ) {
return '';
}
return wfUrlencode( $t->getTalkNsText() );
}
public static function fullpagename( $parser, $title = null ) {
$t = Title::newFromText( $title );
- if ( is_null( $t ) || !$t->canTalk() ) {
+ if ( is_null( $t ) || !$t->canHaveTalkPage() ) {
return '';
}
return wfEscapeWikiText( $t->getPrefixedText() );
}
public static function fullpagenamee( $parser, $title = null ) {
$t = Title::newFromText( $title );
- if ( is_null( $t ) || !$t->canTalk() ) {
+ if ( is_null( $t ) || !$t->canHaveTalkPage() ) {
return '';
}
return wfEscapeWikiText( $t->getPrefixedURL() );
}
public static function talkpagename( $parser, $title = null ) {
$t = Title::newFromText( $title );
- if ( is_null( $t ) || !$t->canTalk() ) {
+ if ( is_null( $t ) || !$t->canHaveTalkPage() ) {
return '';
}
return wfEscapeWikiText( $t->getTalkPage()->getPrefixedText() );
}
public static function talkpagenamee( $parser, $title = null ) {
$t = Title::newFromText( $title );
- if ( is_null( $t ) || !$t->canTalk() ) {
+ if ( is_null( $t ) || !$t->canHaveTalkPage() ) {
return '';
}
return wfEscapeWikiText( $t->getTalkPage()->getPrefixedURL() );
) ) );
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() );