Index: trunk/phase3/includes/LogEventsList.php |
— | — | @@ -365,7 +365,9 @@ |
366 | 366 | $del = ''; // No one should be hiding from the oversight log |
367 | 367 | } else { |
368 | 368 | $target = SpecialPage::getTitleFor( 'Log', $row->log_type ); |
369 | | - $query = array( 'target' => $target->getPrefixedDBkey(), 'logid' => $row->log_id ); |
| 369 | + $page = Title::makeTitle( $row->log_namespace, $row->log_title ); |
| 370 | + $query = array( 'target' => $target->getPrefixedDBkey(), |
| 371 | + 'logid' => $row->log_id, 'page' => $page->getPrefixedDBkey() ); |
370 | 372 | $del = $this->skin->revDeleteLink( $query, |
371 | 373 | self::isDeleted( $row, LogPage::DELETED_RESTRICTED ) ); |
372 | 374 | } |
Index: trunk/phase3/includes/specials/SpecialRevisiondelete.php |
— | — | @@ -49,6 +49,7 @@ |
50 | 50 | return; |
51 | 51 | } |
52 | 52 | $this->page = Title::newFromUrl( $this->target ); |
| 53 | + $this->contextPage = Title::newFromUrl( $wgRequest->getText( 'page' ) ); |
53 | 54 | # If we have revisions, get the title from the first one |
54 | 55 | # since they should all be from the same page. This allows |
55 | 56 | # for more flexibility with page moves... |
— | — | @@ -146,6 +147,19 @@ |
147 | 148 | $safeIds[] = $m[0]; |
148 | 149 | } |
149 | 150 | } |
| 151 | + // Optimization for logs |
| 152 | + if( $action == 'event' ) { |
| 153 | + # If a context page is given, use title,time index |
| 154 | + if( $this->contextPage ) { |
| 155 | + $conds['log_namespace'] = $this->contextPage->getNamespace(); |
| 156 | + $conds['log_title'] = $this->contextPage->getDBKey(); |
| 157 | + } else { |
| 158 | + $first = wfGetDB( DB_SLAVE )->selectField( 'logging', |
| 159 | + 'MIN(log_timestamp)', array('log_id' => $safeIds) ); |
| 160 | + # The event was be hidden after it was made |
| 161 | + $conds[] = "log_timestamp >= {$first}"; // use type,time index |
| 162 | + } |
| 163 | + } |
150 | 164 | // Format is <id1,id2,i3...> |
151 | 165 | if( count($safeIds) ) { |
152 | 166 | $conds[] = "log_params RLIKE '(^|\n|,)(".implode('|',$safeIds).")(,|$)'"; |
— | — | @@ -548,7 +562,8 @@ |
549 | 563 | Xml::submitButton( wfMsg( 'revdelete-submit' ) ) ); |
550 | 564 | $hidden = array( |
551 | 565 | Xml::hidden( 'wpEditToken', $wgUser->editToken() ), |
552 | | - Xml::hidden( 'target', $this->page->getPrefixedText() ), |
| 566 | + Xml::hidden( 'target', $this->page->getPrefixedDBKey() ), |
| 567 | + Xml::hidden( 'page', $this->contextPage ? $this->contextPage->getPrefixedDBKey() : '' ), |
553 | 568 | Xml::hidden( 'type', $this->deleteKey ), |
554 | 569 | Xml::hidden( 'logid', implode(',',$this->logids) ) |
555 | 570 | ); |