From: Matěj Grabovský Date: Tue, 11 May 2010 16:24:14 +0000 (+0000) Subject: (bug 23426) The {{REVISIONMONTH}} variable is now zero-padded and added new variable... X-Git-Tag: 1.31.0-rc.0~36892 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmembres/Category:Foo?a=commitdiff_plain;h=449b936efdd82678cb20971328e46f5740ba9999;p=lhc%2Fweb%2Fwiklou.git (bug 23426) The {{REVISIONMONTH}} variable is now zero-padded and added new variable {{REVISIONMONTH1}} when unpadded version is needed. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index a308a8274f..b1fc9c2230 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -160,6 +160,8 @@ in a negative namespace (which is invalid). * (bug 23422) mp3 files can now be moved * (bug 23448) MediaWiki:Summary-preview is now displayed instead of MediaWiki:Subject-preview when previewing summary +* (bug 23426) The {{REVISIONMONTH}} variable is now zero-padded and added new + variable {{REVISIONMONTH1}} when unpadded version is needed. === API changes in 1.17 === * (bug 22738) Allow filtering by action type on query=logevent diff --git a/includes/MagicWord.php b/includes/MagicWord.php index d741832f61..d05bf19da2 100644 --- a/includes/MagicWord.php +++ b/includes/MagicWord.php @@ -79,6 +79,7 @@ class MagicWord { 'revisionday', 'revisionday2', 'revisionmonth', + 'revisionmonth1', 'revisionyear', 'revisiontimestamp', 'revisionuser', diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 7032b86b1e..9b920aeb76 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -2528,6 +2528,13 @@ class Parser { # *after* a revision ID has been assigned. This is for null edits. $this->mOutput->setFlag( 'vary-revision' ); wfDebug( __METHOD__ . ": {{REVISIONMONTH}} used, setting vary-revision...\n" ); + $value = substr( $this->getRevisionTimestamp(), 4, 2 ); + break; + case 'revisionmonth1': + # Let the edit saving system know we should parse the page + # *after* a revision ID has been assigned. This is for null edits. + $this->mOutput->setFlag( 'vary-revision' ); + wfDebug( __METHOD__ . ": {{REVISIONMONTH1}} used, setting vary-revision...\n" ); $value = intval( substr( $this->getRevisionTimestamp(), 4, 2 ) ); break; case 'revisionyear': diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 712661590f..63e3c4e844 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -311,6 +311,7 @@ $magicWords = array( 'revisionday' => array( 1, 'REVISIONDAY' ), 'revisionday2' => array( 1, 'REVISIONDAY2' ), 'revisionmonth' => array( 1, 'REVISIONMONTH' ), + 'revisionmonth1' => array( 1, 'REVISIONMONTH1' ), 'revisionyear' => array( 1, 'REVISIONYEAR' ), 'revisiontimestamp' => array( 1, 'REVISIONTIMESTAMP' ), 'revisionuser' => array( 1, 'REVISIONUSER' ),