* @ingroup SpecialPage
*/
+use MediaWiki\MediaWikiServices;
+
/**
* XML file reader for the page data importer.
*
$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
} 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 ) ) {
*/
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'] );