r19781 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r19780‎ | r19781 | r19782 >
Date:06:12, 5 February 2007
Author:aaron
Status:old
Tags:
Comment:
*Enforce Hiderevision right better and some minor cleanup.
Modified paths:
  • /trunk/phase3/includes/PageHistory.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/PageHistory.php
@@ -197,6 +197,9 @@
198198 if( $firstInList ) {
199199 // We don't currently handle well changing the top revision's settings
200200 $del = wfMsgHtml( 'rev-delundel' );
 201+ } else if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) {
 202+ // If revision was hidden from sysops
 203+ $del = wfMsgHtml( 'rev-delundel' );
201204 } else {
202205 $del = $this->mSkin->makeKnownLinkObj( $revdel,
203206 wfMsg( 'rev-delundel' ),
@@ -206,23 +209,28 @@
207210 $s .= "(<small>$del</small>) ";
208211 }
209212
 213+ $s .= " $link";
210214 #getUser is safe, but this avoids making the invalid untargeted contribs links
211215 if( $row->rev_deleted & Revision::DELETED_USER ) {
212216 $user = '<span class="history-deleted">' . wfMsg('rev-deleted-user') . '</span>';
213 - $s .= " $link <span class='history-user'>$user</span>";
214 - } else {
215 - $s .= " $link <span class='history-user'>$user</span>";
216217 }
 218+ $s .= " <span class='history-user'>$user</span>";
217219
218220 if( $row->rev_minor_edit ) {
219221 $s .= ' ' . wfElement( 'span', array( 'class' => 'minor' ), wfMsg( 'minoreditletter') );
220222 }
221 -
222 - $s .= $this->mSkin->revComment( $rev );
 223+ #getComment is safe, but this is better formatted
 224+ if( $rev->isDeleted( Revision::DELETED_COMMENT ) ) {
 225+ $s .= " <span class=\"history-deleted\"><span class=\"comment\">" .
 226+ wfMsgHtml( 'rev-deleted-comment' ) . "</span></span>";
 227+ } else {
 228+ $s .= $this->mSkin->commentBlock( $rev->getComment() );
 229+ }
 230+
223231 if ($notificationtimestamp && ($row->rev_timestamp >= $notificationtimestamp)) {
224232 $s .= ' <span class="updatedmarker">' . wfMsgHtml( 'updatedmarker' ) . '</span>';
225233 }
226 - #add blurb about having been deleted
 234+ #add blurb about text having been deleted
227235 if( $row->rev_deleted & Revision::DELETED_TEXT ) {
228236 $s .= ' ' . wfMsgHtml( 'deletedrev' );
229237 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r19810* Fix regression from r19781 causing the little arrow next to section names i...simetrical03:30, 7 February 2007