Index: trunk/extensions/ParserFunctions/ParserFunctions_body.php |
— | — | @@ -505,10 +505,12 @@ |
506 | 506 | return '<strong class="error">' . wfMsgForContent( 'pfunc_time_too_long' ) . '</strong>'; |
507 | 507 | } else { |
508 | 508 | if ( $ts < 100000000000000 ) { // Language can't deal with years after 9999 |
509 | | - if ( $language !== '' ) { // use whatever language is passed as a parameter |
| 509 | + if ( $language !== '' && Language::isValidBuiltInCode( $language ) ) { |
| 510 | + // use whatever language is passed as a parameter |
510 | 511 | $langObject = Language::factory( $language ); |
511 | 512 | $result = $langObject->sprintfDate( $format, $ts ); |
512 | | - } else { // use wiki's content language |
| 513 | + } else { |
| 514 | + // use wiki's content language |
513 | 515 | $result = $parser->getFunctionLang()->sprintfDate( $format, $ts ); |
514 | 516 | } |
515 | 517 | } else { |