* Update title protection to be more consistent with regular protection
authorAlex Z <mrzman@users.mediawiki.org>
Sun, 14 Sep 2008 03:02:02 +0000 (03:02 +0000)
committerAlex Z <mrzman@users.mediawiki.org>
Sun, 14 Sep 2008 03:02:02 +0000 (03:02 +0000)
* Make protection log output somewhat more consistent.

includes/LogPage.php
includes/Title.php

index 2b821e9..312e800 100644 (file)
@@ -204,10 +204,15 @@ class LogPage {
                                                $params[2] = isset( $params[2] ) ? 
                                                        self::formatBlockFlags( $params[2], is_null( $skin ) ) : '';
                                        } else if ( $type == 'protect' && count($params) == 3 ) {
-                                               $details .= " {$params[1]}"; // restrictions and expiries
+                                               $details .= "{$params[1]}"; // restrictions and expiries
                                                if( $params[2] ) {
                                                        $details .= ' ['.wfMsg('protect-summary-cascade').']';
                                                }
+                                               # If this is going to be displayed, make it somewhat consistent with page history
+                                               # and older log entries where everything is treated as a comment
+                                               if (!is_null($skin)) {
+                                                       $details = $skin->commentBlock($details);
+                                               }
                                        }
                                        $rv = wfMsgReal( $wgLogActions[$key], $params, true, !$skin ) . $details;
                                }
index 79c875c..6599b91 100644 (file)
@@ -1403,7 +1403,8 @@ class Title {
                $log = new LogPage( 'protect' );
 
                if( $create_perm ) {
-                       $log->addEntry( $this->mRestrictions['create'] ? 'modify' : 'protect', $this, trim( $reason . " [create=$create_perm] $expiry_description" ) );
+                       $params = array("[create=$create_perm] $expiry_description",'');
+                       $log->addEntry( $this->mRestrictions['create'] ? 'modify' : 'protect', $this, trim( $reason ), $params );
                } else {
                        $log->addEntry( 'unprotect', $this, $reason );
                }