From 08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Mon, 12 Aug 2013 09:28:15 +0200 Subject: Update to MediaWiki 1.21.1 --- extensions/ParserFunctions/ParserFunctions_body.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'extensions/ParserFunctions/ParserFunctions_body.php') diff --git a/extensions/ParserFunctions/ParserFunctions_body.php b/extensions/ParserFunctions/ParserFunctions_body.php index 879b7a15..967e8339 100644 --- a/extensions/ParserFunctions/ParserFunctions_body.php +++ b/extensions/ParserFunctions/ParserFunctions_body.php @@ -452,10 +452,10 @@ class ExtParserFunctions { } else { $tz = new DateTimeZone( date_default_timezone_get() ); } - $dateObject->setTimezone( $tz ); } else { - $dateObject->setTimezone( $utc ); + $tz = $utc; } + $dateObject->setTimezone( $tz ); # Generate timestamp $ts = $dateObject->format( 'YmdHis' ); @@ -471,14 +471,16 @@ class ExtParserFunctions { if ( self::$mTimeChars > self::$mMaxTimeChars ) { return '' . wfMessage( 'pfunc_time_too_long' )->inContentLanguage()->escaped() . ''; } else { - if ( $ts < 100000000000000 ) { // Language can't deal with years after 9999 + if ( $ts < 0 ) { // Language can't deal with BC years + return '' . wfMessage( 'pfunc_time_too_small' )->inContentLanguage()->escaped() . ''; + } elseif ( $ts < 100000000000000 ) { // Language can't deal with years after 9999 if ( $language !== '' && Language::isValidBuiltInCode( $language ) ) { // use whatever language is passed as a parameter $langObject = Language::factory( $language ); - $result = $langObject->sprintfDate( $format, $ts ); + $result = $langObject->sprintfDate( $format, $ts, $tz ); } else { // use wiki's content language - $result = $parser->getFunctionLang()->sprintfDate( $format, $ts ); + $result = $parser->getFunctionLang()->sprintfDate( $format, $ts, $tz ); } } else { return '' . wfMessage( 'pfunc_time_too_big' )->inContentLanguage()->escaped() . ''; -- cgit v1.2.3-54-g00ecf