r48624 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48623‎ | r48624 | r48625 >
Date:04:29, 20 March 2009
Author:aaron
Status:ok
Tags:
Comment:
Don't apply DELETED_USER restriction on query for users with 'suppressrevision'
Modified paths:
  • /trunk/phase3/includes/LogEventsList.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialContributions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/LogEventsList.php
@@ -573,9 +573,12 @@
574574 but for now it won't pass anywhere behind the optimizer */
575575 $this->mConds[] = "NULL";
576576 } else {
 577+ global $wgUser;
577578 $this->mConds['log_user'] = $userid;
578579 // Paranoia: avoid brute force searches (bug 17342)
579 - $this->mConds[] = 'log_deleted & ' . LogPage::DELETED_USER . ' = 0';
 580+ if( !$wgUser->isAllowed( 'suppressrevision' ) ) {
 581+ $this->mConds[] = 'log_deleted & ' . LogPage::DELETED_USER . ' = 0';
 582+ }
580583 $this->user = $usertitle->getText();
581584 }
582585 }
@@ -587,7 +590,7 @@
588591 * @param $pattern String
589592 */
590593 private function limitTitle( $page, $pattern ) {
591 - global $wgMiserMode;
 594+ global $wgMiserMode, $wgUser;
592595
593596 $title = Title::newFromText( $page );
594597 if( strlen($page) == 0 || !$title instanceof Title )
@@ -617,7 +620,9 @@
618621 $this->mConds['log_title'] = $title->getDBkey();
619622 }
620623 // Paranoia: avoid brute force searches (bug 17342)
621 - $this->mConds[] = 'log_deleted & ' . LogPage::DELETED_ACTION . ' = 0';
 624+ if( !$wgUser->isAllowed( 'suppressrevision' ) ) {
 625+ $this->mConds[] = 'log_deleted & ' . LogPage::DELETED_ACTION . ' = 0';
 626+ }
622627 }
623628
624629 public function getQueryInfo() {
@@ -639,7 +644,8 @@
640645 'join_conds' => array( 'user' => array( 'INNER JOIN', 'user_id=log_user' ) ),
641646 );
642647
643 - ChangeTags::modifyDisplayQuery( $info['tables'], $info['fields'], $info['conds'], $info['join_conds'], $this->mTagFilter );
 648+ ChangeTags::modifyDisplayQuery( $info['tables'], $info['fields'], $info['conds'],
 649+ $info['join_conds'], $this->mTagFilter );
644650
645651 return $info;
646652 }
Index: trunk/phase3/includes/specials/SpecialContributions.php
@@ -390,11 +390,14 @@
391391 }
392392
393393 function getQueryInfo() {
 394+ global $wgUser;
394395 list( $tables, $index, $userCond, $join_cond ) = $this->getUserCond();
395396
396397 $conds = array_merge( $userCond, $this->getNamespaceCond() );
397 - // Paranoia: avoid brute force searches (bug 17792)
398 - $conds[] = 'rev_deleted & ' . Revision::DELETED_USER . ' = 0';
 398+ // Paranoia: avoid brute force searches (bug 17342)
 399+ if( !$wgUser->isAllowed( 'suppressrevision' ) ) {
 400+ $conds[] = 'rev_deleted & ' . Revision::DELETED_USER . ' = 0';
 401+ }
399402 $join_cond['page'] = array( 'INNER JOIN', 'page_id=rev_page' );
400403
401404 $queryInfo = array(

Status & tagging log