Index: trunk/phase3/includes/specials/SpecialRevisiondelete.php |
— | — | @@ -113,15 +113,47 @@ |
114 | 114 | } else if( $this->deleteKey == 'logid' ) { |
115 | 115 | $this->showLogItems(); |
116 | 116 | } |
| 117 | + $qc = $this->getLogQueryCond(); |
117 | 118 | # Show relevant lines from the deletion log |
118 | 119 | $wgOut->addHTML( "<h2>" . htmlspecialchars( LogPage::logName( 'delete' ) ) . "</h2>\n" ); |
119 | | - LogEventsList::showLogExtract( $wgOut, 'delete', $this->page->getPrefixedText() ); |
| 120 | + LogEventsList::showLogExtract( $wgOut, 'delete', $this->page->getPrefixedText(), '', 25, $qc ); |
120 | 121 | # Show relevant lines from the suppression log |
121 | 122 | if( $wgUser->isAllowed( 'suppressionlog' ) ) { |
122 | 123 | $wgOut->addHTML( "<h2>" . htmlspecialchars( LogPage::logName( 'suppress' ) ) . "</h2>\n" ); |
123 | | - LogEventsList::showLogExtract( $wgOut, 'suppress', $this->page->getPrefixedText() ); |
| 124 | + LogEventsList::showLogExtract( $wgOut, 'suppress', $this->page->getPrefixedText(), '', 25, $qc ); |
124 | 125 | } |
125 | 126 | } |
| 127 | + |
| 128 | + private function getLogQueryCond() { |
| 129 | + $ids = $safeIds = array(); |
| 130 | + switch( $this->deleteKey ) { |
| 131 | + case 'oldid': |
| 132 | + $ids = $this->oldids; |
| 133 | + break; |
| 134 | + case 'artimestamp': |
| 135 | + $ids = $this->artimestamps; |
| 136 | + break; |
| 137 | + case 'oldimage': |
| 138 | + $ids = $this->oldimgs; |
| 139 | + break; |
| 140 | + case 'fileid': |
| 141 | + $ids = $this->fileids; |
| 142 | + break; |
| 143 | + case 'logid': |
| 144 | + $ids = $this->logids; |
| 145 | + break; |
| 146 | + } |
| 147 | + // Digit chars only |
| 148 | + foreach( $ids as $id ) { |
| 149 | + if( preg_match( '/^\d+$/', $id, $m ) ) { |
| 150 | + $safeIds[] = $m[0]; |
| 151 | + } |
| 152 | + } |
| 153 | + if( count($safeIds) ) { |
| 154 | + return array("log_params RLIKE '".implode('|',$safeIds)."'"); |
| 155 | + } |
| 156 | + return null; |
| 157 | + } |
126 | 158 | |
127 | 159 | private function secureOperation() { |
128 | 160 | global $wgUser; |
— | — | @@ -1497,12 +1529,14 @@ |
1498 | 1530 | * @param string $param, URL param |
1499 | 1531 | * @param Array $items |
1500 | 1532 | */ |
1501 | | - function updateLog( $title, $count, $nbitfield, $obitfield, $comment, $target, $param, $items = array() ) { |
| 1533 | + function updateLog( $title, $count, $nbitfield, $obitfield, $comment, |
| 1534 | + $target, $param, $items = array() ) |
| 1535 | + { |
1502 | 1536 | // Put things hidden from sysops in the oversight log |
1503 | 1537 | $logtype = ( ($nbitfield | $obitfield) & Revision::DELETED_RESTRICTED ) ? 'suppress' : 'delete'; |
1504 | 1538 | $log = new LogPage( $logtype ); |
1505 | 1539 | |
1506 | | - $reason = $this->getLogMessage ( $count, $nbitfield, $obitfield, $comment, $param == 'logid' ); |
| 1540 | + $reason = $this->getLogMessage( $count, $nbitfield, $obitfield, $comment, $param == 'logid' ); |
1507 | 1541 | |
1508 | 1542 | if( $param == 'logid' ) { |
1509 | 1543 | $params = array( implode( ',', $items) ); |