Do not insert page titles into querycache.qc_value
[lhc/web/wiklou.git] / includes / specials / SpecialUpload.php
index 81c9d56..a2edca0 100644 (file)
@@ -311,16 +311,18 @@ class SpecialUpload extends SpecialPage {
        protected function showViewDeletedLinks() {
                $title = Title::makeTitleSafe( NS_FILE, $this->mDesiredDestName );
                $user = $this->getUser();
+               $permissionManager = MediaWikiServices::getInstance()->getPermissionManager();
                // Show a subtitle link to deleted revisions (to sysops et al only)
                if ( $title instanceof Title ) {
                        $count = $title->isDeleted();
-                       if ( $count > 0 && $user->isAllowed( 'deletedhistory' ) ) {
+                       if ( $count > 0 && $permissionManager->userHasRight( $user, 'deletedhistory' ) ) {
                                $restorelink = $this->getLinkRenderer()->makeKnownLink(
                                        SpecialPage::getTitleFor( 'Undelete', $title->getPrefixedText() ),
                                        $this->msg( 'restorelink' )->numParams( $count )->text()
                                );
-                               $link = $this->msg( $user->isAllowed( 'delete' ) ? 'thisisdeleted' : 'viewdeleted' )
-                                       ->rawParams( $restorelink )->parseAsBlock();
+                               $link = $this->msg(
+                                       $permissionManager->userHasRight( $user, 'delete' ) ? 'thisisdeleted' : 'viewdeleted'
+                               )->rawParams( $restorelink )->parseAsBlock();
                                $this->getOutput()->addHTML(
                                        Html::rawElement(
                                                'div',
@@ -486,7 +488,9 @@ class SpecialUpload extends SpecialPage {
                // Fetch the file if required
                $status = $this->mUpload->fetchFile();
                if ( !$status->isOK() ) {
-                       $this->showUploadError( $this->getOutput()->parseAsInterface( $status->getWikiText() ) );
+                       $this->showUploadError( $this->getOutput()->parseAsInterface(
+                               $status->getWikiText( false, false, $this->getLanguage() )
+                       ) );
 
                        return;
                }
@@ -557,7 +561,7 @@ class SpecialUpload extends SpecialPage {
                                $changeTags, $this->getUser() );
                        if ( !$changeTagsStatus->isOK() ) {
                                $this->showUploadError( $this->getOutput()->parseAsInterface(
-                                       $changeTagsStatus->getWikiText()
+                                       $changeTagsStatus->getWikiText( false, false, $this->getLanguage() )
                                ) );
 
                                return;
@@ -574,7 +578,9 @@ class SpecialUpload extends SpecialPage {
 
                if ( !$status->isGood() ) {
                        $this->showRecoverableUploadError(
-                               $this->getOutput()->parseAsInterface( $status->getWikiText() )
+                               $this->getOutput()->parseAsInterface(
+                                       $status->getWikiText( false, false, $this->getLanguage() )
+                               )
                        );
 
                        return;