r66827 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66826‎ | r66827 | r66828 >
Date:14:05, 24 May 2010
Author:aaron
Status:ok
Tags:
Comment:
(bug 23593) Made revision/date links enabled at history/contribs for deleted revs
Modified paths:
  • /trunk/phase3/includes/HistoryPage.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialContributions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/HistoryPage.php
@@ -590,7 +590,7 @@
591591 global $wgLang;
592592 $date = $wgLang->timeanddate( wfTimestamp(TS_MW, $rev->getTimestamp()), true );
593593 $date = htmlspecialchars( $date );
594 - if( !$rev->isDeleted( Revision::DELETED_TEXT ) ) {
 594+ if ( $rev->userCan( Revision::DELETED_TEXT ) ) {
595595 $link = $this->getSkin()->link(
596596 $this->title,
597597 $date,
@@ -599,8 +599,11 @@
600600 array( 'known', 'noclasses' )
601601 );
602602 } else {
603 - $link = "<span class=\"history-deleted\">$date</span>";
 603+ $link = $date;
604604 }
 605+ if ( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
 606+ $link = "<span class=\"history-deleted\">$link</span>";
 607+ }
605608 return $link;
606609 }
607610
Index: trunk/phase3/includes/specials/SpecialContributions.php
@@ -604,16 +604,19 @@
605605
606606 $comment = $wgContLang->getDirMark() . $sk->revComment( $rev, false, true );
607607 $date = $wgLang->timeanddate( wfTimestamp( TS_MW, $row->rev_timestamp ), true );
608 - if( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
609 - $d = '<span class="history-deleted">' . $date . '</span>';
610 - } else {
 608+ if( $rev->userCan( Revision::DELETED_TEXT ) ) {
611609 $d = $sk->linkKnown(
612610 $page,
613611 htmlspecialchars($date),
614612 array(),
615613 array( 'oldid' => intval( $row->rev_id ) )
616614 );
 615+ } else {
 616+ $d = $date;
617617 }
 618+ if( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
 619+ $d = '<span class="history-deleted">' . $d . '</span>';
 620+ }
618621
619622 if( $this->target == 'newbies' ) {
620623 $userlink = ' . . ' . $sk->userLink( $row->rev_user, $row->rev_user_text );

Status & tagging log