From: Tim Starling Date: Tue, 9 Feb 2010 01:17:01 +0000 (+0000) Subject: For r58153: in HistoryPage, removed the user permissions checks for deleted revision... X-Git-Tag: 1.31.0-rc.0~37867 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E/404?a=commitdiff_plain;h=688edac45b4fa6ab6a5ec0ed96382b3f08332009;p=lhc%2Fweb%2Fwiklou.git 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. --- diff --git a/includes/HistoryPage.php b/includes/HistoryPage.php index a9447f1ac1..e515d3dd86 100644 --- a/includes/HistoryPage.php +++ b/includes/HistoryPage.php @@ -129,23 +129,14 @@ class HistoryPage { $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 @@ class HistoryPager extends ReverseChronologicalPager { 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'), diff --git a/includes/Pager.php b/includes/Pager.php index d4aa95df18..e5eef1fce3 100644 --- a/includes/Pager.php +++ b/includes/Pager.php @@ -233,6 +233,13 @@ abstract class IndexPager implements Pager { } } + /** + * 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 @@ abstract class IndexPager implements Pager { * @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'];