r49427 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49426‎ | r49427 | r49428 >
Date:15:45, 12 April 2009
Author:aaron
Status:ok
Tags:
Comment:
More log extract cleanup
Modified paths:
  • /trunk/phase3/includes/specials/SpecialRevisiondelete.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialRevisiondelete.php
@@ -152,23 +152,22 @@
153153 $safeIds[] = $m[0];
154154 }
155155 }
156 - // Optimization for logs
 156+ // Optimization for logs: the event was hidden after it was made
157157 if( $action == 'event' ) {
158158 $dbr = wfGetDB( DB_SLAVE );
159159 # Get the timestamp of the first item
160160 $first = $dbr->selectField( 'logging', 'log_timestamp',
161161 array('log_id' => $safeIds), __METHOD__, array('ORDER BY' => 'log_id') );
162 - # If there are no items, then stop here
163162 if( $first == false ) {
164 - $conds = array('1=0');
165 - return array($conds,$limit);
 163+ return array( array('1=0'), $limit ); // If there are no items, then stop here
166164 }
167 - # The event was be hidden after it was made
168165 $conds[] = 'log_timestamp > '.$dbr->addQuotes($first); // type,time index
169166 }
170167 // Format is <id1,id2,i3...>
171168 if( count($safeIds) ) {
172 - $conds[] = "log_params RLIKE '(^|\n|,)(".implode('|',$safeIds).")(,|\n|$)'";
 169+ // Log deletions do not have an item type, others do...
 170+ $type = ($this->deleteKey != 'logid') ? "^{$this->deleteKey}.*" : '';
 171+ $conds[] = "log_params RLIKE '$type(^|\n|,)(".implode('|',$safeIds).")(,|\n|$)'";
173172 } else {
174173 $conds = array('1=0');
175174 }

Status & tagging log