Revert r91561
authorSam Reed <reedy@users.mediawiki.org>
Fri, 16 Sep 2011 16:55:39 +0000 (16:55 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Fri, 16 Sep 2011 16:55:39 +0000 (16:55 +0000)
RELEASE-NOTES-1.18
includes/Skin.php
includes/SkinTemplate.php
includes/Title.php
includes/specials/SpecialUndelete.php
includes/specials/SpecialUpload.php
languages/Language.php

index e95f3c8..4d21b36 100644 (file)
@@ -338,8 +338,6 @@ production.
   environments
 * (bug 14977) Fixed $wgServer detection in cases where an IPv6 address is used
   as the server name.
-* (bug 19725) Do not list suppressed edits in the "View X deleted edits" link
-  if user cannot view suppressed edits.
 * The View X deleted revisions is now shown again on Special:Upload.
 * (bug 29071) mediawiki.action.watch.ajax.js should pass uselang to API.
 * (bug 28868) Show total pages in the subtitle of an image on the
index dea428d..76a913b 100644 (file)
@@ -638,9 +638,8 @@ abstract class Skin extends ContextSource {
 
                if ( $this->getUser()->isAllowed( 'deletedhistory' ) && !$this->getUser()->isBlocked() &&
                        ( $this->getTitle()->getArticleId() == 0 || $action == 'history' ) ) {
+                       $n = $this->getTitle()->isDeleted();
 
-                       $includeSuppressed = $this->getUser()->isAllowed( 'suppressrevision' );
-                       $n = $this->getTitle()->isDeleted( $includeSuppressed );
 
                        if ( $n ) {
                                if ( $this->getUser()->isAllowed( 'undelete' ) ) {
index 82d4ace..ea6274d 100644 (file)
@@ -951,9 +951,8 @@ class SkinTemplate extends Skin {
                                }
                        } else {
                                // article doesn't exist or is deleted
-                               if ( $user->isAllowed( 'deletedhistory' ) && !$user->isBlocked() ) {
-                                       $includeSuppressed = $user->isAllowed( 'suppressrevision' );
-                                       $n = $title->isDeleted( $includeSuppressed );
+                               if ( $user->isAllowed( 'deletedhistory' ) ) {
+                                       $n = $title->isDeleted();
                                        if( $n ) {
                                                $undelTitle = SpecialPage::getTitleFor( 'Undelete' );
                                                // If the user can't undelete but can view deleted history show them a "View .. deleted" tab instead
index 5211769..418740d 100644 (file)
@@ -2391,37 +2391,21 @@ class Title {
        /**
         * Is there a version of this page in the deletion archive?
         *
-        * @param $includeSuppressed Boolean Include suppressed revisions?
         * @return Int the number of archived revisions
         */
-       public function isDeleted( $includeSuppressed = false ) {
+       public function isDeleted() {
                if ( $this->getNamespace() < 0 ) {
                        $n = 0;
                } else {
                        $dbr = wfGetDB( DB_SLAVE );
-                       $conditions = array( 'ar_namespace' => $this->getNamespace(), 'ar_title' => $this->getDBkey() );
-
-                       if( !$includeSuppressed ) {
-                               $suppressedTextBits = Revision::DELETED_TEXT | Revision::DELETED_RESTRICTED;
-                               $conditions[] = $dbr->bitAnd('ar_deleted', $suppressedTextBits ) .
-                               ' != ' . $suppressedTextBits;
-                       }
 
                        $n = $dbr->selectField( 'archive', 'COUNT(*)',
-                               $conditions,
+                               array( 'ar_namespace' => $this->getNamespace(), 'ar_title' => $this->getDBkey() ),
                                __METHOD__
                        );
                        if ( $this->getNamespace() == NS_FILE ) {
-                               $fconditions = array( 'fa_name' => $this->getDBkey() );
-                               if( !$includeSuppressed ) {
-                                       $suppressedTextBits = File::DELETED_FILE | File::DELETED_RESTRICTED;
-                                       $fconditions[] = $dbr->bitAnd('fa_deleted', $suppressedTextBits ) .
-                                       ' != ' . $suppressedTextBits;
-                               }
-
-                               $n += $dbr->selectField( 'filearchive',
-                                       'COUNT(*)',
-                                       $fconditions,
+                               $n += $dbr->selectField( 'filearchive', 'COUNT(*)',
+                                       array( 'fa_name' => $this->getDBkey() ),
                                        __METHOD__
                                );
                        }
index 2dea1a8..702ee7c 100644 (file)
@@ -62,7 +62,6 @@ class PageArchive {
         * @return ResultWrapper
         */
        public static function listPagesByPrefix( $prefix ) {
-               global $wgUser;
                $dbr = wfGetDB( DB_SLAVE );
 
                $title = Title::newFromText( $prefix );
@@ -78,12 +77,6 @@ class PageArchive {
                        'ar_namespace' => $ns,
                        'ar_title' . $dbr->buildLike( $prefix, $dbr->anyString() ),
                );
-
-               // bug 19725
-               $suppressedText = Revision::DELETED_TEXT | Revision::DELETED_RESTRICTED;
-               if( !$wgUser->isAllowed( 'suppressrevision' ) ) {
-                        $conds[] = $dbr->bitAnd('ar_deleted', $suppressedText ) .
-                                ' != ' . $suppressedText;
                 }
                return self::listPages( $dbr, $conds );
        }
index 0bf52ec..7fd6e1e 100644 (file)
@@ -300,10 +300,9 @@ class SpecialUpload extends SpecialPage {
                $title = Title::makeTitleSafe( NS_FILE, $this->mDesiredDestName );
                $user = $this->getUser();
                // Show a subtitle link to deleted revisions (to sysops et al only)
-               if( $title instanceof Title && $user->isAllowed( 'deletedhistory' ) && !$user->isBlocked() ) {
-                       $canViewSuppress = $user->isAllowed( 'suppressrevision' );
-                       $count = $title->isDeleted( $canViewSuppress );
-                       if ( $count > 0 ) {
+               if( $title instanceof Title ) {
+                       $count = $title->isDeleted();
+                       if ( $count > 0 && $user->isAllowed( 'deletedhistory' ) ) {
                                $link = wfMsgExt(
                                        $user->isAllowed( 'delete' ) ? 'thisisdeleted' : 'viewdeleted',
                                        array( 'parse', 'replaceafter' ),
index a1eba50..c125dd2 100644 (file)
@@ -232,7 +232,7 @@ class Language {
 
        /**
         * Includes language class files
-        * 
+        *
         * @param $class Name of the language class
         */
        public static function preloadLanguageClass( $class ) {
@@ -1259,7 +1259,6 @@ class Language {
                        - floor( ( $gy + 99 ) / 100 )
                        + floor( ( $gy + 399 ) / 400 );
 
-
                // Add days of the past months of this year
                for ( $i = 0; $i < $gm; $i++ ) {
                        $gDayNo += self::$GREG_DAYS[$i];
@@ -3337,7 +3336,7 @@ class Language {
        }
 
        /**
-        * Get the first fallback for a given language. 
+        * Get the first fallback for a given language.
         *
         * @param $code string
         *
@@ -3397,7 +3396,7 @@ class Language {
        static function getMessageFor( $key, $code ) {
                return self::getLocalisationCache()->getSubitem( $code, 'messages', $key );
        }
-       
+
        /**
         * Get all message keys for a given language. This is a faster alternative to
         * array_keys( Language::getMessagesFor( $code ) )