* @return bool
*/
public function importRevision( $revision ) {
+ if ( !$revision->getContent()->getContentHandler()->canBeUsedOn( $revision->getTitle() ) ) {
+ $this->notice( 'import-error-bad-location',
+ $revision->getTitle()->getPrefixedText(),
+ $revision->getID(),
+ $revision->getModel(),
+ $revision->getFormat() );
+
+ return false;
+ }
+
try {
$dbw = wfGetDB( DB_MASTER );
return $dbw->deadlockLoop( array( $revision, 'importOldRevision' ) );
$revision->getModel(),
$revision->getFormat() );
}
+
+ return false;
}
/**
return Status::newFatal( 'import-noarticle' );
}
$link = Title::newFromText( "$interwiki:Special:Export/$page" );
- if ( is_null( $link ) || $link->getInterwiki() == '' ) {
+ if ( is_null( $link ) || !$link->isExternal() ) {
return Status::newFatal( 'importbadinterwiki' );
} else {
$params = array();