X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialImport.php;h=428556f33d3e3b4fd340bc44e0b44b88fce10e7b;hb=520b167979260edf2cee41842e526ec985c37f92;hp=f21c20651b39bf75d9402e01663279e515b640dc;hpb=3e49b37b689a58d9eb475eb0a4ae2d2aa8f5300a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialImport.php b/includes/specials/SpecialImport.php index f21c20651b..428556f33d 100644 --- a/includes/specials/SpecialImport.php +++ b/includes/specials/SpecialImport.php @@ -135,18 +135,19 @@ class SpecialImport extends SpecialPage { } $user = $this->getUser(); + $permissionManager = MediaWikiServices::getInstance()->getPermissionManager(); if ( !$user->matchEditToken( $request->getVal( 'editToken' ) ) ) { $source = Status::newFatal( 'import-token-mismatch' ); } elseif ( $this->sourceName === 'upload' ) { $isUpload = true; $this->usernamePrefix = $this->fullInterwikiPrefix = $request->getVal( 'usernamePrefix' ); - if ( $user->isAllowed( 'importupload' ) ) { + if ( $permissionManager->userHasRight( $user, 'importupload' ) ) { $source = ImportStreamSource::newFromUpload( "xmlimport" ); } else { throw new PermissionsError( 'importupload' ); } } elseif ( $this->sourceName === 'interwiki' ) { - if ( !$user->isAllowed( 'import' ) ) { + if ( !$permissionManager->userHasRight( $user, 'import' ) ) { throw new PermissionsError( 'import' ); } $this->interwiki = $this->fullInterwikiPrefix = $request->getVal( 'interwiki' ); @@ -186,7 +187,8 @@ class SpecialImport extends SpecialPage { $out = $this->getOutput(); if ( !$source->isGood() ) { $out->wrapWikiTextAsInterface( 'error', - $this->msg( 'importfailed', $source->getWikiText() )->plain() + $this->msg( 'importfailed', $source->getWikiText( false, false, $this->getLanguage() ) ) + ->plain() ); } else { $importer = new WikiImporter( $source->value, $this->getConfig() ); @@ -199,7 +201,7 @@ class SpecialImport extends SpecialPage { "