X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=languages%2FLanguage.php;h=a0fa7277933598837e90cacb75901aae8bc2af55;hb=4311edad5f9bad025e587319d4d88b0842fd5b51;hp=80aacb56b3346de66ecdd862b2c72add4f262dd6;hpb=01a2a52dda8063501aa602d19c0c8bea7f8e7710;p=lhc%2Fweb%2Fwiklou.git diff --git a/languages/Language.php b/languages/Language.php index 80aacb56b3..a0fa727793 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -3895,10 +3895,11 @@ class Language { * match up with it. * * @param string $str The validated block duration in English + * @param User $user User object to use timezone from or null for $wgUser * @return string Somehow translated block duration * @see LanguageFi.php for example implementation */ - function translateBlockExpiry( $str ) { + function translateBlockExpiry( $str, User $user = null ) { $duration = SpecialBlock::getSuggestedDurations( $this ); foreach ( $duration as $show => $value ) { if ( strcmp( $str, $value ) == 0 ) { @@ -3924,10 +3925,12 @@ class Language { } else { // It's an absolute timestamp. if ( $time === 0 ) { // wfTimestamp() handles 0 as current time instead of epoch. - return $this->timeanddate( '19700101000000' ); - } else { - return $this->timeanddate( $time ); + $time = '19700101000000'; + } + if ( $user ) { + return $this->userTimeAndDate( $time, $user ); } + return $this->timeanddate( $time ); } }