http://www.mediawiki.org/wiki/Special:Code/MediaWiki/62153

Revision: 62153
Author:   tstarling
Date:     2010-02-09 01:17:01 +0000 (Tue, 09 Feb 2010)

Log Message:
-----------
For r58153: in HistoryPage, removed the user permissions checks for deleted 
revision filtering. Added a tag to the SQL filtered SQL query so that sysadmins 
can easily find the relevant code if there is a problem.

Modified Paths:
--------------
    trunk/phase3/includes/HistoryPage.php
    trunk/phase3/includes/Pager.php

Modified: trunk/phase3/includes/HistoryPage.php
===================================================================
--- trunk/phase3/includes/HistoryPage.php       2010-02-09 01:13:46 UTC (rev 
62152)
+++ trunk/phase3/includes/HistoryPage.php       2010-02-09 01:17:01 UTC (rev 
62153)
@@ -129,23 +129,14 @@
                $tagSelector = ChangeTags::buildTagFilterSelector( $tagFilter );
                /**
                 * Option to show only revisions that have been (partially) 
hidden via RevisionDelete
-                * Note that this can run a *long* time if there are many 
revisions to look at.
-                * We use "isBigDeletion" to determine if the history is too 
big to go through.
-                * Additionally, only users with 'deleterevision' right can 
filter for deleted edits.
                 */
-               if ( $this->title->userCan( 'deleterevision' )
-                       && ( !$this->article->isBigDeletion() || 
$this->title->userCan( 'bigdelete' ) ) )
-               {
-                       $conds = ( $wgRequest->getBool( 'deleted' ) )
-                               ? array("rev_deleted != '0'")
-                               : array();
-                       $checkDeleted = Xml::checkLabel( wfMsg( 
'history-show-deleted' ),
-                               'deleted', 'mw-show-deleted-only', 
$wgRequest->getBool( 'deleted' ) ) . "\n";
-               }
-               else { # Don't filter and don't add the checkbox for filtering
+               if ( $wgRequest->getBool( 'deleted' ) ) {
+                       $conds = array("rev_deleted != '0'");
+               } else {
                        $conds = array();
-                       $checkDeleted = '';
                }
+               $checkDeleted = Xml::checkLabel( wfMsg( 'history-show-deleted' 
),
+                       'deleted', 'mw-show-deleted-only', $wgRequest->getBool( 
'deleted' ) ) . "\n";
 
                $action = htmlspecialchars( $wgScript );
                $wgOut->addHTML(
@@ -325,6 +316,14 @@
                return $this->historyPage->getArticle();
        }
 
+       function getSqlComment() {
+               if ( $this->conds ) {
+                       return 'history page filtered'; // potentially slow, 
see CR r58153
+               } else {
+                       return 'history page unfiltered';
+               }
+       }
+
        function getQueryInfo() {
                $queryInfo = array(
                        'tables'  => array('revision'),

Modified: trunk/phase3/includes/Pager.php
===================================================================
--- trunk/phase3/includes/Pager.php     2010-02-09 01:13:46 UTC (rev 62152)
+++ trunk/phase3/includes/Pager.php     2010-02-09 01:17:01 UTC (rev 62153)
@@ -234,6 +234,13 @@
        }
 
        /**
+        * Get some text to go in brackets in the "function name" part of the 
SQL comment
+        */
+       function getSqlComment() {
+               return get_class( $this );
+       }
+
+       /**
         * Do a query with specified parameters, rather than using the object
         * context
         *
@@ -243,7 +250,7 @@
         * @return ResultWrapper
         */
        function reallyDoQuery( $offset, $limit, $descending ) {
-               $fname = __METHOD__ . ' (' . get_class( $this ) . ')';
+               $fname = __METHOD__ . ' (' . $this->getSqlComment() . ')';
                $info = $this->getQueryInfo();
                $tables = $info['tables'];
                $fields = $info['fields'];



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to