Added concurrent HEAD request support for Swift
[lhc/web/wiklou.git] / includes / Import.php
index 8b7af02..e447e47 100644 (file)
@@ -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();