r40714 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40713‎ | r40714 | r40715 >
Date:21:03, 10 September 2008
Author:aaron
Status:old
Tags:
Comment:
We still want details in page history
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -1824,9 +1824,15 @@
18251825
18261826 $encodedExpiry = Block::encodeExpiry($expiry, $dbw );
18271827
 1828+ $expiry_description = '';
 1829+ if( $encodedExpiry != 'infinity' ) {
 1830+ $expiry_description = ' (' . wfMsgForContent( 'protect-expiring',
 1831+ $wgContLang->timeanddate( $expiry, false, false ) ).')';
 1832+ }
 1833+
18281834 # Prepare a null revision to be added to the history
18291835 $modified = $current != '' && $protect;
1830 - if ( $protect ) {
 1836+ if( $protect ) {
18311837 $comment_type = $modified ? 'modifiedarticleprotection' : 'protectedarticle';
18321838 } else {
18331839 $comment_type = 'unprotectedarticle';
@@ -1842,10 +1848,22 @@
18431849 break;
18441850 }
18451851 }
 1852+
 1853+ $cascade_description = '';
 1854+ if( $cascade ) {
 1855+ $cascade_description = ' ['.wfMsg('protect-summary-cascade').']';
 1856+ }
18461857
18471858 if( $reason )
18481859 $comment .= ": $reason";
18491860
 1861+ $editComment = $comment;
 1862+ if( $protect )
 1863+ $editComment .= " [$updated]";
 1864+ if( $expiry_description && $protect )
 1865+ $editComment .= "$expiry_description";
 1866+ if( $cascade )
 1867+ $editComment .= "$cascade_description";
18501868 # Update restrictions table
18511869 foreach( $limit as $action => $restrictions ) {
18521870 if ($restrictions != '' ) {
@@ -1860,7 +1878,7 @@
18611879 }
18621880
18631881 # Insert a null revision
1864 - $nullRevision = Revision::newNullRevision( $dbw, $id, $comment, true );
 1882+ $nullRevision = Revision::newNullRevision( $dbw, $id, $editComment, true );
18651883 $nullRevId = $nullRevision->insertOn( $dbw );
18661884
18671885 $latest = $this->getLatest();