r40808 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40807‎ | r40808 | r40809 >
Date:03:02, 14 September 2008
Author:mrzman
Status:old
Tags:
Comment:
* Update title protection to be more consistent with regular protection
* Make protection log output somewhat more consistent.
Modified paths:
  • /trunk/phase3/includes/LogPage.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Title.php
@@ -1403,7 +1403,8 @@
14041404 $log = new LogPage( 'protect' );
14051405
14061406 if( $create_perm ) {
1407 - $log->addEntry( $this->mRestrictions['create'] ? 'modify' : 'protect', $this, trim( $reason . " [create=$create_perm] $expiry_description" ) );
 1407+ $params = array("[create=$create_perm] $expiry_description",'');
 1408+ $log->addEntry( $this->mRestrictions['create'] ? 'modify' : 'protect', $this, trim( $reason ), $params );
14081409 } else {
14091410 $log->addEntry( 'unprotect', $this, $reason );
14101411 }
Index: trunk/phase3/includes/LogPage.php
@@ -204,10 +204,15 @@
205205 $params[2] = isset( $params[2] ) ?
206206 self::formatBlockFlags( $params[2], is_null( $skin ) ) : '';
207207 } else if ( $type == 'protect' && count($params) == 3 ) {
208 - $details .= " {$params[1]}"; // restrictions and expiries
 208+ $details .= "{$params[1]}"; // restrictions and expiries
209209 if( $params[2] ) {
210210 $details .= ' ['.wfMsg('protect-summary-cascade').']';
211211 }
 212+ # If this is going to be displayed, make it somewhat consistent with page history
 213+ # and older log entries where everything is treated as a comment
 214+ if (!is_null($skin)) {
 215+ $details = $skin->commentBlock($details);
 216+ }
212217 }
213218 $rv = wfMsgReal( $wgLogActions[$key], $params, true, !$skin ) . $details;
214219 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r40865Revert r40808. No need to make log_params and output uglier due to edit comme...aaron18:50, 15 September 2008