X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_del%27%2C%20idvote=vote.voteid%29%20%7D%7D?a=blobdiff_plain;f=languages%2FLanguage.php;h=e1a20473ee51c482581f587cd540e5f1b594c853;hb=cfaaff106862e84bb15e4bc21acd43843715cb2f;hp=07d47ed67c5f2af599354f83cf7765c82be701f5;hpb=f772fc34e5862d170c657b30888f6314b0d0c926;p=lhc%2Fweb%2Fwiklou.git diff --git a/languages/Language.php b/languages/Language.php index 07d47ed67c..e1a20473ee 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -4483,21 +4483,20 @@ class Language { /** * Decode an expiry (block, protection, etc) which has come from the DB * - * @todo FIXME: why are we returnings DBMS-dependent strings??? - * * @param string $expiry Database expiry String * @param bool|int $format True to process using language functions, or TS_ constant * to return the expiry in a given timestamp + * @param string $inifinity If $format is not true, use this string for infinite expiry * @return string * @since 1.18 */ - public function formatExpiry( $expiry, $format = true ) { - static $infinity; - if ( $infinity === null ) { - $infinity = wfGetDB( DB_SLAVE )->getInfinity(); + public function formatExpiry( $expiry, $format = true, $infinity = 'infinity' ) { + static $dbInfinity; + if ( $dbInfinity === null ) { + $dbInfinity = wfGetDB( DB_SLAVE )->getInfinity(); } - if ( $expiry == '' || $expiry == $infinity ) { + if ( $expiry == '' || $expiry === 'infinity' || $expiry == $dbInfinity ) { return $format === true ? $this->getMessageFromDB( 'infiniteblock' ) : $infinity;