Use consistent notation for "@todo FIXME". Should update http://svn.wikimedia.org...
[lhc/web/wiklou.git] / includes / revisiondelete / RevisionDelete.php
1 <?php
2 /**
3 * List for revision table items
4 *
5 * This will check both the 'revision' table for live revisions and the
6 * 'archive' table for traditionally-deleted revisions that have an
7 * ar_rev_id saved.
8 *
9 * See RevDel_RevisionItem and RevDel_ArchivedRevisionItem for items.
10 */
11 class RevDel_RevisionList extends RevDel_List {
12 var $currentRevId;
13 var $type = 'revision';
14 var $idField = 'rev_id';
15 var $dateField = 'rev_timestamp';
16 var $authorIdField = 'rev_user';
17 var $authorNameField = 'rev_user_text';
18
19 /**
20 * @param $db DatabaseBase
21 * @return mixed
22 */
23 public function doQuery( $db ) {
24 $ids = array_map( 'intval', $this->ids );
25 $live = $db->select( array('revision','page'), '*',
26 array(
27 'rev_page' => $this->title->getArticleID(),
28 'rev_id' => $ids,
29 'rev_page = page_id'
30 ),
31 __METHOD__,
32 array( 'ORDER BY' => 'rev_id DESC' )
33 );
34
35 if ( $live->numRows() >= count( $ids ) ) {
36 // All requested revisions are live, keeps things simple!
37 return $live;
38 }
39
40 // Check if any requested revisions are available fully deleted.
41 $archived = $db->select( array( 'archive' ), '*',
42 array(
43 'ar_rev_id' => $ids
44 ),
45 __METHOD__,
46 array( 'ORDER BY' => 'ar_rev_id DESC' )
47 );
48
49 if ( $archived->numRows() == 0 ) {
50 return $live;
51 } else if ( $live->numRows() == 0 ) {
52 return $archived;
53 } else {
54 // Combine the two! Whee
55 $rows = array();
56 while ( $row = $live->fetchObject() ) {
57 $rows[$row->rev_id] = $row;
58 }
59 while ( $row = $archived->fetchObject() ) {
60 $rows[$row->ar_rev_id] = $row;
61 }
62 krsort( $rows );
63 return new FakeResultWrapper( array_values( $rows ) );
64 }
65 }
66
67 public function newItem( $row ) {
68 if ( isset( $row->rev_id ) ) {
69 return new RevDel_RevisionItem( $this, $row );
70 } elseif ( isset( $row->ar_rev_id ) ) {
71 return new RevDel_ArchivedRevisionItem( $this, $row );
72 } else {
73 // This shouldn't happen. :)
74 var_dump( $row );
75 throw new MWException( 'Invalid row type in RevDel_RevisionList' );
76 }
77 }
78
79 public function getCurrent() {
80 if ( is_null( $this->currentRevId ) ) {
81 $dbw = wfGetDB( DB_MASTER );
82 $this->currentRevId = $dbw->selectField(
83 'page', 'page_latest', $this->title->pageCond(), __METHOD__ );
84 }
85 return $this->currentRevId;
86 }
87
88 public function getSuppressBit() {
89 return Revision::DELETED_RESTRICTED;
90 }
91
92 public function doPreCommitUpdates() {
93 $this->title->invalidateCache();
94 return Status::newGood();
95 }
96
97 public function doPostCommitUpdates() {
98 $this->title->purgeSquid();
99 // Extensions that require referencing previous revisions may need this
100 wfRunHooks( 'ArticleRevisionVisibilitySet', array( &$this->title ) );
101 return Status::newGood();
102 }
103 }
104
105 /**
106 * Item class for a live revision table row
107 */
108 class RevDel_RevisionItem extends RevDel_Item {
109 var $revision;
110
111 public function __construct( $list, $row ) {
112 parent::__construct( $list, $row );
113 $this->revision = new Revision( $row );
114 }
115
116 public function canView() {
117 return $this->revision->userCan( Revision::DELETED_RESTRICTED );
118 }
119
120 public function canViewContent() {
121 return $this->revision->userCan( Revision::DELETED_TEXT );
122 }
123
124 public function getBits() {
125 return $this->revision->mDeleted;
126 }
127
128 public function setBits( $bits ) {
129 $dbw = wfGetDB( DB_MASTER );
130 // Update revision table
131 $dbw->update( 'revision',
132 array( 'rev_deleted' => $bits ),
133 array(
134 'rev_id' => $this->revision->getId(),
135 'rev_page' => $this->revision->getPage(),
136 'rev_deleted' => $this->getBits()
137 ),
138 __METHOD__
139 );
140 if ( !$dbw->affectedRows() ) {
141 // Concurrent fail!
142 return false;
143 }
144 // Update recentchanges table
145 $dbw->update( 'recentchanges',
146 array(
147 'rc_deleted' => $bits,
148 'rc_patrolled' => 1
149 ),
150 array(
151 'rc_this_oldid' => $this->revision->getId(), // condition
152 // non-unique timestamp index
153 'rc_timestamp' => $dbw->timestamp( $this->revision->getTimestamp() ),
154 ),
155 __METHOD__
156 );
157 return true;
158 }
159
160 public function isDeleted() {
161 return $this->revision->isDeleted( Revision::DELETED_TEXT );
162 }
163
164 public function isHideCurrentOp( $newBits ) {
165 return ( $newBits & Revision::DELETED_TEXT )
166 && $this->list->getCurrent() == $this->getId();
167 }
168
169 /**
170 * Get the HTML link to the revision text.
171 * Overridden by RevDel_ArchiveItem.
172 */
173 protected function getRevisionLink() {
174 global $wgLang;
175 $date = $wgLang->timeanddate( $this->revision->getTimestamp(), true );
176 if ( $this->isDeleted() && !$this->canViewContent() ) {
177 return $date;
178 }
179 return $this->special->skin->link(
180 $this->list->title,
181 $date,
182 array(),
183 array(
184 'oldid' => $this->revision->getId(),
185 'unhide' => 1
186 )
187 );
188 }
189
190 /**
191 * Get the HTML link to the diff.
192 * Overridden by RevDel_ArchiveItem
193 */
194 protected function getDiffLink() {
195 if ( $this->isDeleted() && !$this->canViewContent() ) {
196 return wfMsgHtml('diff');
197 } else {
198 return
199 $this->special->skin->link(
200 $this->list->title,
201 wfMsgHtml('diff'),
202 array(),
203 array(
204 'diff' => $this->revision->getId(),
205 'oldid' => 'prev',
206 'unhide' => 1
207 ),
208 array(
209 'known',
210 'noclasses'
211 )
212 );
213 }
214 }
215
216 public function getHTML() {
217 $difflink = $this->getDiffLink();
218 $revlink = $this->getRevisionLink();
219 $userlink = $this->special->skin->revUserLink( $this->revision );
220 $comment = $this->special->skin->revComment( $this->revision );
221 if ( $this->isDeleted() ) {
222 $revlink = "<span class=\"history-deleted\">$revlink</span>";
223 }
224 return "<li>($difflink) $revlink $userlink $comment</li>";
225 }
226 }
227
228 /**
229 * List for archive table items, i.e. revisions deleted via action=delete
230 */
231 class RevDel_ArchiveList extends RevDel_RevisionList {
232 var $type = 'archive';
233 var $idField = 'ar_timestamp';
234 var $dateField = 'ar_timestamp';
235 var $authorIdField = 'ar_user';
236 var $authorNameField = 'ar_user_text';
237
238 /**
239 * @param $db DatabaseBase
240 * @return mixed
241 */
242 public function doQuery( $db ) {
243 $timestamps = array();
244 foreach ( $this->ids as $id ) {
245 $timestamps[] = $db->timestamp( $id );
246 }
247 return $db->select( 'archive', '*',
248 array(
249 'ar_namespace' => $this->title->getNamespace(),
250 'ar_title' => $this->title->getDBkey(),
251 'ar_timestamp' => $timestamps
252 ),
253 __METHOD__,
254 array( 'ORDER BY' => 'ar_timestamp DESC' )
255 );
256 }
257
258 public function newItem( $row ) {
259 return new RevDel_ArchiveItem( $this, $row );
260 }
261
262 public function doPreCommitUpdates() {
263 return Status::newGood();
264 }
265
266 public function doPostCommitUpdates() {
267 return Status::newGood();
268 }
269 }
270
271 /**
272 * Item class for a archive table row
273 */
274 class RevDel_ArchiveItem extends RevDel_RevisionItem {
275 public function __construct( $list, $row ) {
276 RevDel_Item::__construct( $list, $row );
277 $this->revision = Revision::newFromArchiveRow( $row,
278 array( 'page' => $this->list->title->getArticleId() ) );
279 }
280
281 public function getId() {
282 # Convert DB timestamp to MW timestamp
283 return $this->revision->getTimestamp();
284 }
285
286 public function setBits( $bits ) {
287 $dbw = wfGetDB( DB_MASTER );
288 $dbw->update( 'archive',
289 array( 'ar_deleted' => $bits ),
290 array( 'ar_namespace' => $this->list->title->getNamespace(),
291 'ar_title' => $this->list->title->getDBkey(),
292 // use timestamp for index
293 'ar_timestamp' => $this->row->ar_timestamp,
294 'ar_rev_id' => $this->row->ar_rev_id,
295 'ar_deleted' => $this->getBits()
296 ),
297 __METHOD__ );
298 return (bool)$dbw->affectedRows();
299 }
300
301 protected function getRevisionLink() {
302 global $wgLang;
303 $undelete = SpecialPage::getTitleFor( 'Undelete' );
304 $date = $wgLang->timeanddate( $this->revision->getTimestamp(), true );
305 if ( $this->isDeleted() && !$this->canViewContent() ) {
306 return $date;
307 }
308 return $this->special->skin->link( $undelete, $date, array(),
309 array(
310 'target' => $this->list->title->getPrefixedText(),
311 'timestamp' => $this->revision->getTimestamp()
312 ) );
313 }
314
315 protected function getDiffLink() {
316 if ( $this->isDeleted() && !$this->canViewContent() ) {
317 return wfMsgHtml( 'diff' );
318 }
319 $undelete = SpecialPage::getTitleFor( 'Undelete' );
320 return $this->special->skin->link( $undelete, wfMsgHtml('diff'), array(),
321 array(
322 'target' => $this->list->title->getPrefixedText(),
323 'diff' => 'prev',
324 'timestamp' => $this->revision->getTimestamp()
325 ) );
326 }
327 }
328
329
330 /**
331 * Item class for a archive table row by ar_rev_id -- actually
332 * used via RevDel_RevisionList.
333 */
334 class RevDel_ArchivedRevisionItem extends RevDel_ArchiveItem {
335 public function __construct( $list, $row ) {
336 RevDel_Item::__construct( $list, $row );
337
338 $this->revision = Revision::newFromArchiveRow( $row,
339 array( 'page' => $this->list->title->getArticleId() ) );
340 }
341
342 public function getId() {
343 return $this->revision->getId();
344 }
345
346 public function setBits( $bits ) {
347 $dbw = wfGetDB( DB_MASTER );
348 $dbw->update( 'archive',
349 array( 'ar_deleted' => $bits ),
350 array( 'ar_rev_id' => $this->row->ar_rev_id,
351 'ar_deleted' => $this->getBits()
352 ),
353 __METHOD__ );
354 return (bool)$dbw->affectedRows();
355 }
356 }
357
358 /**
359 * List for oldimage table items
360 */
361 class RevDel_FileList extends RevDel_List {
362 var $type = 'oldimage';
363 var $idField = 'oi_archive_name';
364 var $dateField = 'oi_timestamp';
365 var $authorIdField = 'oi_user';
366 var $authorNameField = 'oi_user_text';
367 var $storeBatch, $deleteBatch, $cleanupBatch;
368
369 /**
370 * @param $db DatabaseBase
371 * @return mixed
372 */
373 public function doQuery( $db ) {
374 $archiveNames = array();
375 foreach( $this->ids as $timestamp ) {
376 $archiveNames[] = $timestamp . '!' . $this->title->getDBkey();
377 }
378 return $db->select( 'oldimage', '*',
379 array(
380 'oi_name' => $this->title->getDBkey(),
381 'oi_archive_name' => $archiveNames
382 ),
383 __METHOD__,
384 array( 'ORDER BY' => 'oi_timestamp DESC' )
385 );
386 }
387
388 public function newItem( $row ) {
389 return new RevDel_FileItem( $this, $row );
390 }
391
392 public function clearFileOps() {
393 $this->deleteBatch = array();
394 $this->storeBatch = array();
395 $this->cleanupBatch = array();
396 }
397
398 public function doPreCommitUpdates() {
399 $status = Status::newGood();
400 $repo = RepoGroup::singleton()->getLocalRepo();
401 if ( $this->storeBatch ) {
402 $status->merge( $repo->storeBatch( $this->storeBatch, FileRepo::OVERWRITE_SAME ) );
403 }
404 if ( !$status->isOK() ) {
405 return $status;
406 }
407 if ( $this->deleteBatch ) {
408 $status->merge( $repo->deleteBatch( $this->deleteBatch ) );
409 }
410 if ( !$status->isOK() ) {
411 // Running cleanupDeletedBatch() after a failed storeBatch() with the DB already
412 // modified (but destined for rollback) causes data loss
413 return $status;
414 }
415 if ( $this->cleanupBatch ) {
416 $status->merge( $repo->cleanupDeletedBatch( $this->cleanupBatch ) );
417 }
418 return $status;
419 }
420
421 public function doPostCommitUpdates() {
422 $file = wfLocalFile( $this->title );
423 $file->purgeCache();
424 $file->purgeDescription();
425 return Status::newGood();
426 }
427
428 public function getSuppressBit() {
429 return File::DELETED_RESTRICTED;
430 }
431 }
432
433 /**
434 * Item class for an oldimage table row
435 */
436 class RevDel_FileItem extends RevDel_Item {
437
438 /**
439 * @var File
440 */
441 var $file;
442
443 public function __construct( $list, $row ) {
444 parent::__construct( $list, $row );
445 $this->file = RepoGroup::singleton()->getLocalRepo()->newFileFromRow( $row );
446 }
447
448 public function getId() {
449 $parts = explode( '!', $this->row->oi_archive_name );
450 return $parts[0];
451 }
452
453 public function canView() {
454 return $this->file->userCan( File::DELETED_RESTRICTED );
455 }
456
457 public function canViewContent() {
458 return $this->file->userCan( File::DELETED_FILE );
459 }
460
461 public function getBits() {
462 return $this->file->getVisibility();
463 }
464
465 public function setBits( $bits ) {
466 # Queue the file op
467 # @todo FIXME: Move to LocalFile.php
468 if ( $this->isDeleted() ) {
469 if ( $bits & File::DELETED_FILE ) {
470 # Still deleted
471 } else {
472 # Newly undeleted
473 $key = $this->file->getStorageKey();
474 $srcRel = $this->file->repo->getDeletedHashPath( $key ) . $key;
475 $this->list->storeBatch[] = array(
476 $this->file->repo->getVirtualUrl( 'deleted' ) . '/' . $srcRel,
477 'public',
478 $this->file->getRel()
479 );
480 $this->list->cleanupBatch[] = $key;
481 }
482 } elseif ( $bits & File::DELETED_FILE ) {
483 # Newly deleted
484 $key = $this->file->getStorageKey();
485 $dstRel = $this->file->repo->getDeletedHashPath( $key ) . $key;
486 $this->list->deleteBatch[] = array( $this->file->getRel(), $dstRel );
487 }
488
489 # Do the database operations
490 $dbw = wfGetDB( DB_MASTER );
491 $dbw->update( 'oldimage',
492 array( 'oi_deleted' => $bits ),
493 array(
494 'oi_name' => $this->row->oi_name,
495 'oi_timestamp' => $this->row->oi_timestamp,
496 'oi_deleted' => $this->getBits()
497 ),
498 __METHOD__
499 );
500 return (bool)$dbw->affectedRows();
501 }
502
503 public function isDeleted() {
504 return $this->file->isDeleted( File::DELETED_FILE );
505 }
506
507 /**
508 * Get the link to the file.
509 * Overridden by RevDel_ArchivedFileItem.
510 */
511 protected function getLink() {
512 global $wgLang, $wgUser;
513 $date = $wgLang->timeanddate( $this->file->getTimestamp(), true );
514 if ( $this->isDeleted() ) {
515 # Hidden files...
516 if ( !$this->canViewContent() ) {
517 $link = $date;
518 } else {
519 $link = $this->special->skin->link(
520 $this->special->getTitle(),
521 $date, array(),
522 array(
523 'target' => $this->list->title->getPrefixedText(),
524 'file' => $this->file->getArchiveName(),
525 'token' => $wgUser->editToken( $this->file->getArchiveName() )
526 )
527 );
528 }
529 return '<span class="history-deleted">' . $link . '</span>';
530 } else {
531 # Regular files...
532 return Xml::element( 'a', array( 'href' => $this->file->getUrl() ), $date );
533 }
534 }
535 /**
536 * Generate a user tool link cluster if the current user is allowed to view it
537 * @return string HTML
538 */
539 protected function getUserTools() {
540 if( $this->file->userCan( Revision::DELETED_USER ) ) {
541 $link = $this->special->skin->userLink( $this->file->user, $this->file->user_text ) .
542 $this->special->skin->userToolLinks( $this->file->user, $this->file->user_text );
543 } else {
544 $link = wfMsgHtml( 'rev-deleted-user' );
545 }
546 if( $this->file->isDeleted( Revision::DELETED_USER ) ) {
547 return '<span class="history-deleted">' . $link . '</span>';
548 }
549 return $link;
550 }
551
552 /**
553 * Wrap and format the file's comment block, if the current
554 * user is allowed to view it.
555 *
556 * @return string HTML
557 */
558 protected function getComment() {
559 if( $this->file->userCan( File::DELETED_COMMENT ) ) {
560 $block = $this->special->skin->commentBlock( $this->file->description );
561 } else {
562 $block = ' ' . wfMsgHtml( 'rev-deleted-comment' );
563 }
564 if( $this->file->isDeleted( File::DELETED_COMMENT ) ) {
565 return "<span class=\"history-deleted\">$block</span>";
566 }
567 return $block;
568 }
569
570 public function getHTML() {
571 global $wgLang;
572 $data =
573 wfMsg(
574 'widthheight',
575 $wgLang->formatNum( $this->file->getWidth() ),
576 $wgLang->formatNum( $this->file->getHeight() )
577 ) .
578 ' (' .
579 wfMsgExt( 'nbytes', 'parsemag', $wgLang->formatNum( $this->file->getSize() ) ) .
580 ')';
581
582 return '<li>' . $this->getLink() . ' ' . $this->getUserTools() . ' ' .
583 $data . ' ' . $this->getComment(). '</li>';
584 }
585 }
586
587 /**
588 * List for filearchive table items
589 */
590 class RevDel_ArchivedFileList extends RevDel_FileList {
591 var $type = 'filearchive';
592 var $idField = 'fa_id';
593 var $dateField = 'fa_timestamp';
594 var $authorIdField = 'fa_user';
595 var $authorNameField = 'fa_user_text';
596
597 /**
598 * @param $db DatabaseBase
599 * @return mixed
600 */
601 public function doQuery( $db ) {
602 $ids = array_map( 'intval', $this->ids );
603 return $db->select( 'filearchive', '*',
604 array(
605 'fa_name' => $this->title->getDBkey(),
606 'fa_id' => $ids
607 ),
608 __METHOD__,
609 array( 'ORDER BY' => 'fa_id DESC' )
610 );
611 }
612
613 public function newItem( $row ) {
614 return new RevDel_ArchivedFileItem( $this, $row );
615 }
616 }
617
618 /**
619 * Item class for a filearchive table row
620 */
621 class RevDel_ArchivedFileItem extends RevDel_FileItem {
622 public function __construct( $list, $row ) {
623 RevDel_Item::__construct( $list, $row );
624 $this->file = ArchivedFile::newFromRow( $row );
625 }
626
627 public function getId() {
628 return $this->row->fa_id;
629 }
630
631 public function setBits( $bits ) {
632 $dbw = wfGetDB( DB_MASTER );
633 $dbw->update( 'filearchive',
634 array( 'fa_deleted' => $bits ),
635 array(
636 'fa_id' => $this->row->fa_id,
637 'fa_deleted' => $this->getBits(),
638 ),
639 __METHOD__
640 );
641 return (bool)$dbw->affectedRows();
642 }
643
644 protected function getLink() {
645 global $wgLang, $wgUser;
646 $date = $wgLang->timeanddate( $this->file->getTimestamp(), true );
647 $undelete = SpecialPage::getTitleFor( 'Undelete' );
648 $key = $this->file->getKey();
649 # Hidden files...
650 if( !$this->canViewContent() ) {
651 $link = $date;
652 } else {
653 $link = $this->special->skin->link( $undelete, $date, array(),
654 array(
655 'target' => $this->list->title->getPrefixedText(),
656 'file' => $key,
657 'token' => $wgUser->editToken( $key )
658 )
659 );
660 }
661 if( $this->isDeleted() ) {
662 $link = '<span class="history-deleted">' . $link . '</span>';
663 }
664 return $link;
665 }
666 }
667
668 /**
669 * List for logging table items
670 */
671 class RevDel_LogList extends RevDel_List {
672 var $type = 'logging';
673 var $idField = 'log_id';
674 var $dateField = 'log_timestamp';
675 var $authorIdField = 'log_user';
676 var $authorNameField = 'log_user_text';
677
678 /**
679 * @param $db DatabaseBase
680 * @return mixed
681 */
682 public function doQuery( $db ) {
683 $ids = array_map( 'intval', $this->ids );
684 return $db->select( 'logging', '*',
685 array( 'log_id' => $ids ),
686 __METHOD__,
687 array( 'ORDER BY' => 'log_id DESC' )
688 );
689 }
690
691 public function newItem( $row ) {
692 return new RevDel_LogItem( $this, $row );
693 }
694
695 public function getSuppressBit() {
696 return Revision::DELETED_RESTRICTED;
697 }
698
699 public function getLogAction() {
700 return 'event';
701 }
702
703 public function getLogParams( $params ) {
704 return array(
705 implode( ',', $params['ids'] ),
706 "ofield={$params['oldBits']}",
707 "nfield={$params['newBits']}"
708 );
709 }
710 }
711
712 /**
713 * Item class for a logging table row
714 */
715 class RevDel_LogItem extends RevDel_Item {
716 public function canView() {
717 return LogEventsList::userCan( $this->row, Revision::DELETED_RESTRICTED );
718 }
719
720 public function canViewContent() {
721 return true; // none
722 }
723
724 public function getBits() {
725 return $this->row->log_deleted;
726 }
727
728 public function setBits( $bits ) {
729 $dbw = wfGetDB( DB_MASTER );
730 $dbw->update( 'recentchanges',
731 array(
732 'rc_deleted' => $bits,
733 'rc_patrolled' => 1
734 ),
735 array(
736 'rc_logid' => $this->row->log_id,
737 'rc_timestamp' => $this->row->log_timestamp // index
738 ),
739 __METHOD__
740 );
741 $dbw->update( 'logging',
742 array( 'log_deleted' => $bits ),
743 array(
744 'log_id' => $this->row->log_id,
745 'log_deleted' => $this->getBits()
746 ),
747 __METHOD__
748 );
749 return (bool)$dbw->affectedRows();
750 }
751
752 public function getHTML() {
753 global $wgLang;
754
755 $date = htmlspecialchars( $wgLang->timeanddate( $this->row->log_timestamp ) );
756 $paramArray = LogPage::extractParams( $this->row->log_params );
757 $title = Title::makeTitle( $this->row->log_namespace, $this->row->log_title );
758
759 // Log link for this page
760 $loglink = $this->special->skin->link(
761 SpecialPage::getTitleFor( 'Log' ),
762 wfMsgHtml( 'log' ),
763 array(),
764 array( 'page' => $title->getPrefixedText() )
765 );
766 // Action text
767 if( !$this->canView() ) {
768 $action = '<span class="history-deleted">' . wfMsgHtml('rev-deleted-event') . '</span>';
769 } else {
770 $action = LogPage::actionText( $this->row->log_type, $this->row->log_action, $title,
771 $this->special->skin, $paramArray, true, true );
772 if( $this->row->log_deleted & LogPage::DELETED_ACTION )
773 $action = '<span class="history-deleted">' . $action . '</span>';
774 }
775 // User links
776 $userLink = $this->special->skin->userLink( $this->row->log_user,
777 User::WhoIs( $this->row->log_user ) );
778 if( LogEventsList::isDeleted($this->row,LogPage::DELETED_USER) ) {
779 $userLink = '<span class="history-deleted">' . $userLink . '</span>';
780 }
781 // Comment
782 $comment = $wgLang->getDirMark() . $this->special->skin->commentBlock( $this->row->log_comment );
783 if( LogEventsList::isDeleted($this->row,LogPage::DELETED_COMMENT) ) {
784 $comment = '<span class="history-deleted">' . $comment . '</span>';
785 }
786 return "<li>($loglink) $date $userLink $action $comment</li>";
787 }
788 }