* @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
* Fetches text contents of the current element, assuming
* no sub-elements or such scary things.
* @return string
- * @access private
+ * @private
*/
public function nodeContents() {
if ( $this->reader->isEmptyElement ) {
$revision->setText( $text );
}
- if ( isset( $revisionInfo['timestamp'] ) ) {
- $revision->setTimestamp( $revisionInfo['timestamp'] );
- } else {
- $revision->setTimestamp( wfTimestampNow() );
- }
+ $revision->setTimestamp( $revisionInfo['timestamp'] ?? wfTimestampNow() );
if ( isset( $revisionInfo['comment'] ) ) {
$revision->setComment( $revisionInfo['comment'] );