From: Aaron Schulz Date: Sun, 12 Apr 2009 15:45:27 +0000 (+0000) Subject: More log extract cleanup X-Git-Tag: 1.31.0-rc.0~42161 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/?a=commitdiff_plain;h=c7f5348a6004adf27a657ab02ac020a753157829;p=lhc%2Fweb%2Fwiklou.git More log extract cleanup --- diff --git a/includes/specials/SpecialRevisiondelete.php b/includes/specials/SpecialRevisiondelete.php index b78cb2f533..28a7d4c699 100644 --- a/includes/specials/SpecialRevisiondelete.php +++ b/includes/specials/SpecialRevisiondelete.php @@ -152,23 +152,22 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { $safeIds[] = $m[0]; } } - // Optimization for logs + // Optimization for logs: the event was hidden after it was made if( $action == 'event' ) { $dbr = wfGetDB( DB_SLAVE ); # Get the timestamp of the first item $first = $dbr->selectField( 'logging', 'log_timestamp', array('log_id' => $safeIds), __METHOD__, array('ORDER BY' => 'log_id') ); - # If there are no items, then stop here if( $first == false ) { - $conds = array('1=0'); - return array($conds,$limit); + return array( array('1=0'), $limit ); // If there are no items, then stop here } - # The event was be hidden after it was made $conds[] = 'log_timestamp > '.$dbr->addQuotes($first); // type,time index } // Format is if( count($safeIds) ) { - $conds[] = "log_params RLIKE '(^|\n|,)(".implode('|',$safeIds).")(,|\n|$)'"; + // Log deletions do not have an item type, others do... + $type = ($this->deleteKey != 'logid') ? "^{$this->deleteKey}.*" : ''; + $conds[] = "log_params RLIKE '$type(^|\n|,)(".implode('|',$safeIds).")(,|\n|$)'"; } else { $conds = array('1=0'); }