Extra sanity check
authorAaron Schulz <aaron@users.mediawiki.org>
Sat, 24 May 2008 23:56:07 +0000 (23:56 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Sat, 24 May 2008 23:56:07 +0000 (23:56 +0000)
includes/Article.php
includes/FileDeleteForm.php

index 0cda456..2099d4d 100644 (file)
@@ -2019,7 +2019,8 @@ class Article {
                        $reason = $this->DeleteReason;
                }
                # Flag to hide all contents of the archived revisions
-               $suppress = $wgRequest->getVal( 'wpSuppress' ) && $wgUser->isAllowed('hiderevision');
+               $suppress = $wgRequest->getVal( 'wpSuppress' ) && $wgUser->isAllowed('deleterevision') 
+                       && $wgUser->isAllowed('hiderevision');
 
                # This code desperately needs to be totally rewritten
 
@@ -2170,7 +2171,7 @@ class Article {
                $wgOut->setRobotpolicy( 'noindex,nofollow' );
                $wgOut->addWikiMsg( 'confirmdeletetext' );
 
-               if( $wgUser->isAllowed( 'hiderevision' ) ) {
+               if( $wgUser->isAllowed( 'deleterevision' ) && $wgUser->isAllowed( 'hiderevision' ) ) {
                        $suppress = "<tr id=\"wpDeleteSuppressRow\" name=\"wpDeleteSuppressRow\"><td></td><td>";
                        $suppress .= Xml::checkLabel( wfMsg( 'revdelete-suppress' ), 'wpSuppress', 'wpSuppress', false, array( 'tabindex' => '2' ) );
                        $suppress .= "</td></tr>";
index 3e194b7..2debd4c 100644 (file)
@@ -45,7 +45,8 @@ class FileDeleteForm {
                $this->oldimage = $wgRequest->getText( 'oldimage', false );
                $token = $wgRequest->getText( 'wpEditToken' );
                # Flag to hide all contents of the archived revisions
-               $suppress = $wgRequest->getVal( 'wpSuppress' ) && $wgUser->isAllowed('hiderevision');
+               $suppress = $wgRequest->getVal( 'wpSuppress' ) && $wgUser->isAllowed('deleterevision') 
+                       && $wgUser->isAllowed('hiderevision');
 
                if( $this->oldimage && !self::isValidOldSpec($this->oldimage) ) {
                        $wgOut->showUnexpectedValueError( 'oldimage', htmlspecialchars( $this->oldimage ) );
@@ -126,7 +127,7 @@ class FileDeleteForm {
                global $wgOut, $wgUser, $wgRequest, $wgContLang;
                $align = $wgContLang->isRtl() ? 'left' : 'right';
 
-               if( $wgUser->isAllowed( 'hiderevision' ) ) {
+               if( $wgUser->isAllowed( 'deleterevision' ) && $wgUser->isAllowed( 'hiderevision' ) ) {
                        $suppress = "<tr id=\"wpDeleteSuppressRow\" name=\"wpDeleteSuppressRow\"><td></td><td>";
                        $suppress .= Xml::checkLabel( wfMsg( 'revdelete-suppress' ), 'wpSuppress', 'wpSuppress', false, array( 'tabindex' => '2' ) );
                        $suppress .= "</td></tr>";