Merge "(bug 39793) #simpleSearch placeholder styles for Firefox, IE"
[lhc/web/wiklou.git] / includes / specials / SpecialRevisiondelete.php
index be432ac..089f967 100644 (file)
@@ -163,8 +163,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
 
                # No targets?
                if( !isset( self::$allowedTypes[$this->typeName] ) || count( $this->ids ) == 0 ) {
-                       $output->showErrorPage( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
-                       return;
+                       throw new ErrorPageError( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
                }
                $this->typeInfo = self::$allowedTypes[$this->typeName];
                $this->mIsAllowed = $user->isAllowed( $this->typeInfo['permission'] );
@@ -206,12 +205,14 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
 
                $qc = $this->getLogQueryCond();
                # Show relevant lines from the deletion log
-               $output->addHTML( "<h2>" . htmlspecialchars( LogPage::logName( 'delete' ) ) . "</h2>\n" );
+               $deleteLogPage = new LogPage( 'delete' );
+               $output->addHTML( "<h2>" . $deleteLogPage->getName()->escaped() . "</h2>\n" );
                LogEventsList::showLogExtract( $output, 'delete',
                        $this->targetObj, '', array( 'lim' => 25, 'conds' => $qc ) );
                # Show relevant lines from the suppression log
                if( $user->isAllowed( 'suppressionlog' ) ) {
-                       $output->addHTML( "<h2>" . htmlspecialchars( LogPage::logName( 'suppress' ) ) . "</h2>\n" );
+                       $suppressLogPage = new LogPage( 'suppress' );
+                       $output->addHTML( "<h2>" . $suppressLogPage->getName()->escaped()  . "</h2>\n" );
                        LogEventsList::showLogExtract( $output, 'suppress',
                                $this->targetObj, '', array( 'lim' => 25, 'conds' => $qc ) );
                }
@@ -284,11 +285,10 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                $user = $this->getUser();
                if( !$oimage->userCan( File::DELETED_FILE, $user ) ) {
                        if( $oimage->isDeleted( File::DELETED_RESTRICTED ) ) {
-                               $this->getOutput()->permissionRequired( 'suppressrevision' );
+                               throw new PermissionsError( 'suppressrevision' );
                        } else {
-                               $this->getOutput()->permissionRequired( 'deletedtext' );
+                               throw new PermissionsError( 'deletedtext' );
                        }
-                       return;
                }
                if ( !$user->matchEditToken( $this->token, $archiveName ) ) {
                        $lang = $this->getLanguage();
@@ -358,8 +358,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                        $item = $list->current();
                        if ( !$item->canView() ) {
                                if( !$this->submitClicked ) {
-                                       $this->getOutput()->permissionRequired( 'suppressrevision' );
-                                       return;
+                                       throw new PermissionsError( 'suppressrevision' );
                                }
                                $UserAllowed = false;
                        }
@@ -368,8 +367,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                }
 
                if( !$numRevisions ) {
-                       $this->getOutput()->showErrorPage( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
-                       return;
+                       throw new ErrorPageError( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
                }
 
                $this->getOutput()->addHTML( "</ul>" );
@@ -526,8 +524,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                }
                # Can the user set this field?
                if( $bitParams[Revision::DELETED_RESTRICTED]==1 && !$this->getUser()->isAllowed('suppressrevision') ) {
-                       $this->getOutput()->permissionRequired( 'suppressrevision' );
-                       return false;
+                       throw new PermissionsError( 'suppressrevision' );
                }
                # If the save went through, go to success message...
                $status = $this->save( $bitParams, $comment, $this->targetObj );