r62153 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62152‎ | r62153 | r62154 >
Date:01:17, 9 February 2010
Author:tstarling
Status:ok
Tags:
Comment:
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 (modified) (history)
  • /trunk/phase3/includes/Pager.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Pager.php
@@ -234,6 +234,13 @@
235235 }
236236
237237 /**
 238+ * Get some text to go in brackets in the "function name" part of the SQL comment
 239+ */
 240+ function getSqlComment() {
 241+ return get_class( $this );
 242+ }
 243+
 244+ /**
238245 * Do a query with specified parameters, rather than using the object
239246 * context
240247 *
@@ -243,7 +250,7 @@
244251 * @return ResultWrapper
245252 */
246253 function reallyDoQuery( $offset, $limit, $descending ) {
247 - $fname = __METHOD__ . ' (' . get_class( $this ) . ')';
 254+ $fname = __METHOD__ . ' (' . $this->getSqlComment() . ')';
248255 $info = $this->getQueryInfo();
249256 $tables = $info['tables'];
250257 $fields = $info['fields'];
Index: trunk/phase3/includes/HistoryPage.php
@@ -129,23 +129,14 @@
130130 $tagSelector = ChangeTags::buildTagFilterSelector( $tagFilter );
131131 /**
132132 * Option to show only revisions that have been (partially) hidden via RevisionDelete
133 - * Note that this can run a *long* time if there are many revisions to look at.
134 - * We use "isBigDeletion" to determine if the history is too big to go through.
135 - * Additionally, only users with 'deleterevision' right can filter for deleted edits.
136133 */
137 - if ( $this->title->userCan( 'deleterevision' )
138 - && ( !$this->article->isBigDeletion() || $this->title->userCan( 'bigdelete' ) ) )
139 - {
140 - $conds = ( $wgRequest->getBool( 'deleted' ) )
141 - ? array("rev_deleted != '0'")
142 - : array();
143 - $checkDeleted = Xml::checkLabel( wfMsg( 'history-show-deleted' ),
144 - 'deleted', 'mw-show-deleted-only', $wgRequest->getBool( 'deleted' ) ) . "\n";
145 - }
146 - else { # Don't filter and don't add the checkbox for filtering
 134+ if ( $wgRequest->getBool( 'deleted' ) ) {
 135+ $conds = array("rev_deleted != '0'");
 136+ } else {
147137 $conds = array();
148 - $checkDeleted = '';
149138 }
 139+ $checkDeleted = Xml::checkLabel( wfMsg( 'history-show-deleted' ),
 140+ 'deleted', 'mw-show-deleted-only', $wgRequest->getBool( 'deleted' ) ) . "\n";
150141
151142 $action = htmlspecialchars( $wgScript );
152143 $wgOut->addHTML(
@@ -325,6 +316,14 @@
326317 return $this->historyPage->getArticle();
327318 }
328319
 320+ function getSqlComment() {
 321+ if ( $this->conds ) {
 322+ return 'history page filtered'; // potentially slow, see CR r58153
 323+ } else {
 324+ return 'history page unfiltered';
 325+ }
 326+ }
 327+
329328 function getQueryInfo() {
330329 $queryInfo = array(
331330 'tables' => array('revision'),

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r58153Partially fixing bug 20186: Allow filtering history for revision deletion. Ch...churchofemacs18:45, 26 October 2009

Status & tagging log