X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FImport.php;h=e447e47561f3f2ca42a92e826f07b948fff74161;hb=6b1a60a1caa605033a70ebb25831d2ddd071e73a;hp=8b7af02a0f2636ebeff68ff4410b6ce28c3aaa4e;hpb=b65669ff7adbbde55872a8ddd93214a9e1df75c6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Import.php b/includes/Import.php index 8b7af02a0f..e447e47561 100644 --- a/includes/Import.php +++ b/includes/Import.php @@ -252,6 +252,16 @@ class WikiImporter { * @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' ) ); @@ -262,6 +272,8 @@ class WikiImporter { $revision->getModel(), $revision->getFormat() ); } + + return false; } /** @@ -1717,7 +1729,7 @@ class ImportStreamSource { 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();