Index: trunk/phase3/includes/specials/SpecialRevisiondelete.php |
— | — | @@ -165,7 +165,9 @@ |
166 | 166 | } |
167 | 167 | // Format is <id1,id2,i3...> |
168 | 168 | if( count($safeIds) ) { |
169 | | - $conds[] = "log_params RLIKE '(^|\n|,)(".implode('|',$safeIds).")(,|$)'"; |
| 169 | + $conds[] = "log_params RLIKE '(^|\n|,)(".implode('|',$safeIds).")(,|\n|$)'"; |
| 170 | + } else { |
| 171 | + $conds = array('1=0'); |
170 | 172 | } |
171 | 173 | return array($conds,$limit); |
172 | 174 | } |
— | — | @@ -678,9 +680,8 @@ |
679 | 681 | $pageLink = "<a href=\"{$url}\">{$date}</a>"; |
680 | 682 | } |
681 | 683 | |
682 | | - $data = wfMsg( 'widthheight', |
683 | | - $wgLang->formatNum( $file->getWidth() ), |
684 | | - $wgLang->formatNum( $file->getHeight() ) ) . |
| 684 | + $data = wfMsg( 'widthheight', $wgLang->formatNum( $file->getWidth() ), |
| 685 | + $wgLang->formatNum( $file->getHeight() ) ) . |
685 | 686 | ' (' . wfMsgExt( 'nbytes', 'parsemag', $wgLang->formatNum( $file->getSize() ) ) . ')'; |
686 | 687 | $data = htmlspecialchars( $data ); |
687 | 688 | |
— | — | @@ -707,9 +708,8 @@ |
708 | 709 | $del = ' <tt>' . wfMsgHtml( 'deletedrev' ) . '</tt>'; |
709 | 710 | } |
710 | 711 | |
711 | | - $data = wfMsg( 'widthheight', |
712 | | - $wgLang->formatNum( $file->getWidth() ), |
713 | | - $wgLang->formatNum( $file->getHeight() ) ) . |
| 712 | + $data = wfMsg( 'widthheight', $wgLang->formatNum( $file->getWidth() ), |
| 713 | + $wgLang->formatNum( $file->getHeight() ) ) . |
714 | 714 | ' (' . wfMsgExt( 'nbytes', 'parsemag', $wgLang->formatNum( $file->getSize() ) ) . ')'; |
715 | 715 | $data = htmlspecialchars( $data ); |
716 | 716 | |
— | — | @@ -1467,7 +1467,7 @@ |
1468 | 1468 | * @param int $diff The xor of the old and new bitfields. |
1469 | 1469 | * @param array $arr The array to update. |
1470 | 1470 | */ |
1471 | | - function checkItem( $desc, $field, $diff, $new, &$arr ) { |
| 1471 | + protected static function checkItem( $desc, $field, $diff, $new, &$arr ) { |
1472 | 1472 | if( $diff & $field ) { |
1473 | 1473 | $arr[ ( $new & $field ) ? 0 : 1 ][] = $desc; |
1474 | 1474 | } |
— | — | @@ -1485,15 +1485,15 @@ |
1486 | 1486 | * @param int $o The old bitfield. |
1487 | 1487 | * @return An array as described above. |
1488 | 1488 | */ |
1489 | | - function getChanges( $n, $o ) { |
| 1489 | + protected static function getChanges( $n, $o ) { |
1490 | 1490 | $diff = $n ^ $o; |
1491 | 1491 | $ret = array( 0 => array(), 1 => array(), 2 => array() ); |
1492 | 1492 | // Build bitfield changes in language |
1493 | | - $this->checkItem( wfMsgForContent( 'revdelete-content' ), |
| 1493 | + self::checkItem( wfMsgForContent( 'revdelete-content' ), |
1494 | 1494 | Revision::DELETED_TEXT, $diff, $n, $ret ); |
1495 | | - $this->checkItem( wfMsgForContent( 'revdelete-summary' ), |
| 1495 | + self::checkItem( wfMsgForContent( 'revdelete-summary' ), |
1496 | 1496 | Revision::DELETED_COMMENT, $diff, $n, $ret ); |
1497 | | - $this->checkItem( wfMsgForContent( 'revdelete-uname' ), |
| 1497 | + self::checkItem( wfMsgForContent( 'revdelete-uname' ), |
1498 | 1498 | Revision::DELETED_USER, $diff, $n, $ret ); |
1499 | 1499 | // Restriction application to sysops |
1500 | 1500 | if( $diff & Revision::DELETED_RESTRICTED ) { |
— | — | @@ -1513,15 +1513,12 @@ |
1514 | 1514 | * @param int $count The number of effected revisions. |
1515 | 1515 | * @param int $nbitfield The new bitfield for the revision. |
1516 | 1516 | * @param int $obitfield The old bitfield for the revision. |
1517 | | - * @param string $comment The comment associated with the change. |
1518 | 1517 | * @param bool $isForLog |
1519 | 1518 | */ |
1520 | | - function getLogMessage( $count, $nbitfield, $obitfield, $comment, $isForLog = false ) { |
1521 | | - global $wgContLang; |
1522 | | - |
| 1519 | + public static function getLogMessage( $count, $nbitfield, $obitfield, $isForLog = false ) { |
| 1520 | + global $wgLang; |
1523 | 1521 | $s = ''; |
1524 | | - $changes = $this->getChanges( $nbitfield, $obitfield ); |
1525 | | - |
| 1522 | + $changes = self::getChanges( $nbitfield, $obitfield ); |
1526 | 1523 | if( count( $changes[0] ) ) { |
1527 | 1524 | $s .= wfMsgForContent ( 'revdelete-hid', implode ( ', ', $changes[0] ) ); |
1528 | 1525 | } |
— | — | @@ -1532,15 +1529,9 @@ |
1533 | 1530 | if( count( $changes[2] ) ) { |
1534 | 1531 | $s .= $s ? ' (' . $changes[2][0] . ')' : $changes[2][0]; |
1535 | 1532 | } |
1536 | | - |
1537 | 1533 | $msg = $isForLog ? 'logdelete-log-message' : 'revdelete-log-message'; |
1538 | | - $ret = wfMsgExt ( $msg, array( 'parsemag', 'content' ), |
1539 | | - $s, $wgContLang->formatNum( $count ) ); |
| 1534 | + return wfMsgExt( $msg, array( 'parsemag', 'content' ), $s, $wgLang->formatNum($count) ); |
1540 | 1535 | |
1541 | | - if( $comment ) $ret .= ": $comment"; |
1542 | | - |
1543 | | - return $ret; |
1544 | | - |
1545 | 1536 | } |
1546 | 1537 | |
1547 | 1538 | /** |
— | — | @@ -1561,16 +1552,15 @@ |
1562 | 1553 | $logtype = ( ($nbitfield | $obitfield) & Revision::DELETED_RESTRICTED ) ? |
1563 | 1554 | 'suppress' : 'delete'; |
1564 | 1555 | $log = new LogPage( $logtype ); |
| 1556 | + $itemCSV = implode(',',$items); |
1565 | 1557 | |
1566 | | - $reason = $this->getLogMessage( $count, $nbitfield, $obitfield, $comment, $param == 'logid' ); |
1567 | | - |
1568 | 1558 | if( $param == 'logid' ) { |
1569 | | - $params = array( implode( ',', $items) ); |
1570 | | - $log->addEntry( 'event', $title, $reason, $params ); |
| 1559 | + $params = array( $itemCSV, "ofield={$obitfield}", "nfield={$nbitfield}" ); |
| 1560 | + $log->addEntry( 'event', $title, $comment, $params ); |
1571 | 1561 | } else { |
1572 | 1562 | // Add params for effected page and ids |
1573 | | - $params = array( $param, implode( ',', $items) ); |
1574 | | - $log->addEntry( 'revision', $title, $reason, $params ); |
| 1563 | + $params = array( $param, $itemCSV, "ofield={$obitfield}", "nfield={$nbitfield}" ); |
| 1564 | + $log->addEntry( 'revision', $title, $comment, $params ); |
1575 | 1565 | } |
1576 | 1566 | } |
1577 | 1567 | } |
Index: trunk/phase3/includes/LogPage.php |
— | — | @@ -201,6 +201,7 @@ |
202 | 202 | } else { |
203 | 203 | $details = ''; |
204 | 204 | array_unshift( $params, $titleLink ); |
| 205 | + // User suppression |
205 | 206 | if ( preg_match( '/^(block|suppress)\/(block|reblock)$/', $key ) ) { |
206 | 207 | if ( $skin ) { |
207 | 208 | $params[1] = '<span title="' . htmlspecialchars( $params[1] ). '">' . |
— | — | @@ -210,6 +211,7 @@ |
211 | 212 | } |
212 | 213 | $params[2] = isset( $params[2] ) ? |
213 | 214 | self::formatBlockFlags( $params[2], is_null( $skin ) ) : ''; |
| 215 | + // Page protections |
214 | 216 | } else if ( $type == 'protect' && count($params) == 3 ) { |
215 | 217 | $details .= " {$params[1]}"; // restrictions and expiries |
216 | 218 | if( $params[2] ) { |
— | — | @@ -219,6 +221,7 @@ |
220 | 222 | $details .= ' ['.wfMsgForContent('protect-summary-cascade').']'; |
221 | 223 | } |
222 | 224 | } |
| 225 | + // Page moves |
223 | 226 | } else if ( $type == 'move' && count( $params ) == 3 ) { |
224 | 227 | if( $params[2] ) { |
225 | 228 | if ( $skin ) { |
— | — | @@ -227,6 +230,18 @@ |
228 | 231 | $details .= ' [' . wfMsgForContent( 'move-redirect-suppressed' ) . ']'; |
229 | 232 | } |
230 | 233 | } |
| 234 | + // Revision deletion |
| 235 | + } else if ( preg_match( '/^(delete|suppress)\/revision$/', $key ) && count( $params ) == 5 ) { |
| 236 | + $count = substr_count( $params[1], ',' ) + 1; // revisions |
| 237 | + $ofield = intval( substr( $params[3], 7 ) ); // <ofield=x> |
| 238 | + $nfield = intval( substr( $params[4], 7 ) ); // <nfield=x> |
| 239 | + $details .= ': '.RevisionDeleter::getLogMessage( $count, $nfield, $ofield, false ); |
| 240 | + // Log deletion |
| 241 | + } else if ( preg_match( '/^(delete|suppress)\/event$/', $key ) && count( $params ) == 4 ) { |
| 242 | + $count = substr_count( $params[1], ',' ) + 1; // log items |
| 243 | + $ofield = intval( substr( $params[2], 7 ) ); // <ofield=x> |
| 244 | + $nfield = intval( substr( $params[3], 7 ) ); // <nfield=x> |
| 245 | + $details .= ': '.RevisionDeleter::getLogMessage( $count, $nfield, $ofield, true ); |
231 | 246 | } |
232 | 247 | $rv = wfMsgReal( $wgLogActions[$key], $params, true, !$skin ) . $details; |
233 | 248 | } |
Index: trunk/phase3/includes/LogEventsList.php |
— | — | @@ -282,7 +282,7 @@ |
283 | 283 | 'mergepoint' => $paramArray[1] ) ) ) . ')'; |
284 | 284 | // If an edit was hidden from a page give a review link to the history |
285 | 285 | } else if( self::typeAction($row,array('delete','suppress'),'revision','deleterevision') ) { |
286 | | - if( count($paramArray) == 2 ) { |
| 286 | + if( count($paramArray) >= 2 ) { |
287 | 287 | $revdel = SpecialPage::getTitleFor( 'Revisiondelete' ); |
288 | 288 | // Different revision types use different URL params... |
289 | 289 | $key = $paramArray[0]; |
— | — | @@ -304,7 +304,7 @@ |
305 | 305 | } |
306 | 306 | // Hidden log items, give review link |
307 | 307 | } else if( self::typeAction($row,array('delete','suppress'),'event','deleterevision') ) { |
308 | | - if( count($paramArray) == 1 ) { |
| 308 | + if( count($paramArray) >= 1 ) { |
309 | 309 | $revdel = SpecialPage::getTitleFor( 'Revisiondelete' ); |
310 | 310 | // $paramArray[1] is a CVS of the IDs |
311 | 311 | $Ids = explode( ',', $paramArray[0] ); |