Merge "mw.widgets.CategorySelector: Don't lose namespace-like prefixes from category...
[lhc/web/wiklou.git] / includes / specials / SpecialRevisiondelete.php
index c98aa46..44e44ba 100644 (file)
@@ -109,6 +109,10 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                parent::__construct( 'Revisiondelete', 'deletedhistory' );
        }
 
+       public function doesWrites() {
+               return true;
+       }
+
        public function execute( $par ) {
                $this->useTransactionalTimeLimit();
 
@@ -118,6 +122,11 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                $output = $this->getOutput();
                $user = $this->getUser();
 
+               // Check blocks
+               if ( $user->isBlocked() ) {
+                       throw new UserBlockedError( $user->getBlock() );
+               }
+
                $this->setHeaders();
                $this->outputHeader();
                $request = $this->getRequest();
@@ -170,11 +179,10 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                $this->typeLabels = self::$UILabels[$this->typeName];
                $list = $this->getList();
                $list->reset();
-               $bitfield = $list->current()->getBits();
                $this->mIsAllowed = $user->isAllowed( RevisionDeleter::getRestriction( $this->typeName ) );
                $canViewSuppressedOnly = $this->getUser()->isAllowed( 'viewsuppressed' ) &&
                        !$this->getUser()->isAllowed( 'suppressrevision' );
-               $pageIsSuppressed = $bitfield & Revision::DELETED_RESTRICTED;
+               $pageIsSuppressed = $list->areAnySuppressed();
                $this->mIsAllowed = $this->mIsAllowed && !( $canViewSuppressedOnly && $pageIsSuppressed );
 
                $this->otherReason = $request->getVal( 'wpReason' );
@@ -330,10 +338,10 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                        return;
                }
                $this->getOutput()->disable();
-               # We mustn't allow the output to be Squid cached, otherwise
+               # We mustn't allow the output to be CDN cached, otherwise
                # if an admin previews a deleted image, and it's cached, then
                # a user without appropriate permissions can toddle off and
-               # nab the image, and Squid will serve it
+               # nab the image, and CDN will serve it
                $this->getRequest()->response()->header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', 0 ) . ' GMT' );
                $this->getRequest()->response()->header(
                        'Cache-Control: no-cache, no-store, max-age=0, must-revalidate'