X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=blobdiff_plain;f=includes%2Fimport%2FWikiImporter.php;h=00a7b52992cbaffd3eab9c027ebec2bd1ca46f9d;hb=90d4f56fe46140f9e97e2fa72698f98b57447fe5;hp=8991f5ef4d4a72193a91973d6743384868cc62d5;hpb=801c6810a741cffed1174267958bd3426fd1d191;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/import/WikiImporter.php b/includes/import/WikiImporter.php index 8991f5ef4d..00a7b52992 100644 --- a/includes/import/WikiImporter.php +++ b/includes/import/WikiImporter.php @@ -24,6 +24,8 @@ * @ingroup SpecialPage */ +use MediaWiki\MediaWikiServices; + /** * XML file reader for the page data importer. * @@ -286,11 +288,10 @@ class WikiImporter { $status->fatal( 'import-rootpage-invalid' ); } else { if ( !MWNamespace::hasSubpages( $title->getNamespace() ) ) { - global $wgContLang; - $displayNSText = $title->getNamespace() == NS_MAIN ? wfMessage( 'blanknamespace' )->text() - : $wgContLang->getNsText( $title->getNamespace() ); + : 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 @@ -784,7 +785,7 @@ class WikiImporter { } elseif ( $tag == 'revision' || $tag == 'upload' ) { if ( !isset( $title ) ) { $title = $this->processTitle( $pageInfo['title'], - isset( $pageInfo['ns'] ) ? $pageInfo['ns'] : null ); + $pageInfo['ns'] ?? null ); // $title is either an array of two titles or false. if ( is_array( $title ) ) { @@ -1015,7 +1016,7 @@ class WikiImporter { */ private function processUpload( $pageInfo, $uploadInfo ) { $revision = new WikiRevision( $this->config ); - $text = isset( $uploadInfo['text'] ) ? $uploadInfo['text'] : ''; + $text = $uploadInfo['text'] ?? ''; $revision->setTitle( $pageInfo['_title'] ); $revision->setID( $pageInfo['id'] );