Index: trunk/extensions/ParserFunctions/ParserFunctions_body.php |
— | — | @@ -504,13 +504,18 @@ |
505 | 505 | if ( self::$mTimeChars > self::$mMaxTimeChars ) { |
506 | 506 | return '<strong class="error">' . wfMsgForContent( 'pfunc_time_too_long' ) . '</strong>'; |
507 | 507 | } else { |
508 | | - if ( $language == 'user' ) { // use user's interface language |
509 | | - $result = $wgLang->sprintfDate( $format, $ts ); |
510 | | - } elseif ( $language !== '' ) { // use whatever language is passed as a parameter |
511 | | - $langObject = Language::factory( $language ); |
512 | | - $result = $langObject->sprintfDate( $format, $ts ); |
513 | | - } else { // use wiki's content language |
514 | | - $result = $wgContLang->sprintfDate( $format, $ts ); |
| 508 | + if ( $ts < 100000000000000 ) { // Language can't deal with years after 9999 |
| 509 | + if ( $language == 'user' ) { // use user's interface language |
| 510 | + $parser->getOptions()->getUserLang(); |
| 511 | + $result = $wgLang->sprintfDate( $format, $ts ); |
| 512 | + } elseif ( $language !== '' ) { // use whatever language is passed as a parameter |
| 513 | + $langObject = Language::factory( $language ); |
| 514 | + $result = $langObject->sprintfDate( $format, $ts ); |
| 515 | + } else { // use wiki's content language |
| 516 | + $result = $wgContLang->sprintfDate( $format, $ts ); |
| 517 | + } |
| 518 | + } else { |
| 519 | + return '<strong class="error">' . wfMsgForContent( 'pfunc_time_too_big' ) . '</strong>'; |
515 | 520 | } |
516 | 521 | } |
517 | 522 | } |
Index: trunk/extensions/ParserFunctions/ParserFunctions.i18n.php |
— | — | @@ -12,6 +12,7 @@ |
13 | 13 | 'pfunc_desc' => 'Enhance parser with logical functions', |
14 | 14 | 'pfunc_time_error' => 'Error: invalid time', |
15 | 15 | 'pfunc_time_too_long' => 'Error: too many #time calls', |
| 16 | + 'pfunc_time_too_big' => 'Error: #time only supports years up to 9999', |
16 | 17 | 'pfunc_rel2abs_invalid_depth' => 'Error: Invalid depth in path: "$1" (tried to access a node above the root node)', |
17 | 18 | 'pfunc_expr_stack_exhausted' => 'Expression error: Stack exhausted', |
18 | 19 | 'pfunc_expr_unexpected_number' => 'Expression error: Unexpected number', |