Index: trunk/phase3/includes/specials/SpecialRevisiondelete.php |
— | — | @@ -152,23 +152,22 @@ |
153 | 153 | $safeIds[] = $m[0]; |
154 | 154 | } |
155 | 155 | } |
156 | | - // Optimization for logs |
| 156 | + // Optimization for logs: the event was hidden after it was made |
157 | 157 | if( $action == 'event' ) { |
158 | 158 | $dbr = wfGetDB( DB_SLAVE ); |
159 | 159 | # Get the timestamp of the first item |
160 | 160 | $first = $dbr->selectField( 'logging', 'log_timestamp', |
161 | 161 | array('log_id' => $safeIds), __METHOD__, array('ORDER BY' => 'log_id') ); |
162 | | - # If there are no items, then stop here |
163 | 162 | 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 |
166 | 164 | } |
167 | | - # The event was be hidden after it was made |
168 | 165 | $conds[] = 'log_timestamp > '.$dbr->addQuotes($first); // type,time index |
169 | 166 | } |
170 | 167 | // Format is <id1,id2,i3...> |
171 | 168 | 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|$)'"; |
173 | 172 | } else { |
174 | 173 | $conds = array('1=0'); |
175 | 174 | } |