From: Niklas Laxström Date: Thu, 14 Oct 2010 15:59:20 +0000 (+0000) Subject: * (Bug 25451) Language::time() and ::date() misfunction when given timestamps in... X-Git-Tag: 1.31.0-rc.0~34506 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=9ad58598da5f31a4a0bd47fbef54302f7546a8c3;p=lhc%2Fweb%2Fwiklou.git * (Bug 25451) Language::time() and ::date() misfunction when given timestamps in wrong format Convert given times to correct format like ::timeandate() already does. Based on patch by Thorsten Glaser . --- diff --git a/languages/Language.php b/languages/Language.php index 09c66adc75..fa605ab477 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -1496,6 +1496,7 @@ class Language { * @return string */ function date( $ts, $adj = false, $format = true, $timecorrection = false ) { + $ts = wfTimestamp( TS_MW, $ts ); if ( $adj ) { $ts = $this->userAdjust( $ts, $timecorrection ); } @@ -1514,6 +1515,7 @@ class Language { * @return string */ function time( $ts, $adj = false, $format = true, $timecorrection = false ) { + $ts = wfTimestamp( TS_MW, $ts ); if ( $adj ) { $ts = $this->userAdjust( $ts, $timecorrection ); }