if ( isset( $params['from'] ) ) {
$fromTitle = Title::newFromText( $params['from'] );
- if ( !$fromTitle ) {
+ if ( !$fromTitle || $fromTitle->isExternal() ) {
$this->dieUsageMsg( array( 'invalidtitle', $params['from'] ) );
}
} elseif ( isset( $params['fromid'] ) ) {
$fromTalk = $fromTitle->getTalkPage();
$toTitle = Title::newFromText( $params['to'] );
- if ( !$toTitle ) {
+ if ( !$toTitle || $toTitle->isExternal() ) {
$this->dieUsageMsg( array( 'invalidtitle', $params['to'] ) );
}
$toTalk = $toTitle->getTalkPage();
$r['redirectcreated'] = '';
}
- if( $toTitleExists ) {
+ if ( $toTitleExists ) {
$r['moveoverredirect'] = '';
}
if ( $retval === true ) {
$r['talkfrom'] = $fromTalk->getPrefixedText();
$r['talkto'] = $toTalk->getPrefixedText();
- if( $toTalkExists ) {
+ if ( $toTalkExists ) {
$r['talkmoveoverredirect'] = '';
}
} else {
public function getExamples() {
return array(
- 'api.php?action=move&from=Exampel&to=Example&token=123ABC&reason=Misspelled%20title&movetalk=&noredirect='
+ 'api.php?action=move&from=Badtitle&to=Goodtitle&token=123ABC&reason=Misspelled%20title&movetalk=&noredirect='
);
}