X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FImport.php;h=b18e25716aa3f3cf5ecbd050e95c01b21db1d876;hb=9ffd4f085d71116f0a643dd0cbd10f1008fa4ace;hp=721b94b5e38617a71765cc5702bfb6d16da96744;hpb=873344fc1cc355b5132103170aba7e21b74864ad;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Import.php b/includes/Import.php index 721b94b5e3..b18e25716a 100644 --- a/includes/Import.php +++ b/includes/Import.php @@ -3,7 +3,7 @@ * MediaWiki page data importer. * * Copyright © 2003,2005 Brion Vibber - * http://www.mediawiki.org/ + * https://www.mediawiki.org/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -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; } /**