X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fimport%2FWikiImporter.php;h=41ec673a185b5c53c876fa4482338d274ae00819;hb=08e27d6d40ed2f6eea8abc509254e11c92212a8d;hp=bd19aa75139ff2468081e57029a13ee821e1a82b;hpb=57cb9aa21c2c8616e4fb8441ab5cabb9c912a89c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/import/WikiImporter.php b/includes/import/WikiImporter.php index bd19aa7513..41ec673a18 100644 --- a/includes/import/WikiImporter.php +++ b/includes/import/WikiImporter.php @@ -286,18 +286,16 @@ class WikiImporter { if ( !$title || $title->isExternal() ) { $status->fatal( 'import-rootpage-invalid' ); + } elseif ( !MWNamespace::hasSubpages( $title->getNamespace() ) ) { + $displayNSText = $title->getNamespace() == NS_MAIN + ? wfMessage( 'blanknamespace' )->text() + : MediaWikiServices::getInstance()->getContentLanguage()-> + getNsText( $title->getNamespace() ); + $status->fatal( 'import-rootpage-nosubpage', $displayNSText ); } else { - if ( !MWNamespace::hasSubpages( $title->getNamespace() ) ) { - $displayNSText = $title->getNamespace() == NS_MAIN - ? wfMessage( 'blanknamespace' )->text() - : MediaWikiServices::getInstance()->getContentLanguage()-> - getNsText( $title->getNamespace() ); - $status->fatal( 'import-rootpage-nosubpage', $displayNSText ); - } else { - // set namespace to 'all', so the namespace check in processTitle() can pass - $this->setTargetNamespace( null ); - $this->setImportTitleFactory( new SubpageImportTitleFactory( $title ) ); - } + // set namespace to 'all', so the namespace check in processTitle() can pass + $this->setTargetNamespace( null ); + $this->setImportTitleFactory( new SubpageImportTitleFactory( $title ) ); } } return $status;