diff options
| author | Chris Smith <toonarmy@phpbb.com> | 2010-07-09 20:39:30 +0100 |
|---|---|---|
| committer | Oleg Pudeyev <oleg@bsdpower.com> | 2012-03-14 22:57:30 -0400 |
| commit | f17664a00c9fa3b80a887bde2cdb2424a5d5567a (patch) | |
| tree | 0173bf13279eee31bb9d7f1ca5ba3599b0b2525a /phpBB | |
| parent | 190b019fa28f59c018554916e33446d93efb7311 (diff) | |
| download | forums-f17664a00c9fa3b80a887bde2cdb2424a5d5567a.tar forums-f17664a00c9fa3b80a887bde2cdb2424a5d5567a.tar.gz forums-f17664a00c9fa3b80a887bde2cdb2424a5d5567a.tar.bz2 forums-f17664a00c9fa3b80a887bde2cdb2424a5d5567a.tar.xz forums-f17664a00c9fa3b80a887bde2cdb2424a5d5567a.zip | |
[feature/new-tz-handling] Correct a bug preventing multiple formats working.
PHPBB3-9558
Diffstat (limited to 'phpBB')
| -rw-r--r-- | phpBB/includes/datetime.php | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/phpBB/includes/datetime.php b/phpBB/includes/datetime.php index 22b7f871fd..15e3c8b0b7 100644 --- a/phpBB/includes/datetime.php +++ b/phpBB/includes/datetime.php @@ -149,22 +149,22 @@ class phpbb_datetime extends DateTime if (!isset(self::$format_cache[$lang])) { self::$format_cache[$lang] = array(); + } - if (!isset(self::$format_cache[$lang][$format])) + if (!isset(self::$format_cache[$lang][$format])) + { + // Is the user requesting a friendly date format (i.e. 'Today 12:42')? + self::$format_cache[$lang][$format] = array( + 'is_short' => strpos($format, self::RELATIVE_WRAPPER) !== false, + 'format_short' => substr($format, 0, strpos($format, self::RELATIVE_WRAPPER)) . self::RELATIVE_WRAPPER . self::RELATIVE_WRAPPER . substr(strrchr($format, self::RELATIVE_WRAPPER), 1), + 'format_long' => str_replace(self::RELATIVE_WRAPPER, '', $format), + 'lang' => $user->lang['datetime'], + ); + + // Short representation of month in format? Some languages use different terms for the long and short format of May + if ((strpos($format, '\M') === false && strpos($format, 'M') !== false) || (strpos($format, '\r') === false && strpos($format, 'r') !== false)) { - // Is the user requesting a friendly date format (i.e. 'Today 12:42')? - self::$format_cache[$lang][$format] = array( - 'is_short' => strpos($format, self::RELATIVE_WRAPPER) !== false, - 'format_short' => substr($format, 0, strpos($format, self::RELATIVE_WRAPPER)) . self::RELATIVE_WRAPPER . self::RELATIVE_WRAPPER . substr(strrchr($format, self::RELATIVE_WRAPPER), 1), - 'format_long' => str_replace(self::RELATIVE_WRAPPER, '', $format), - 'lang' => $user->lang['datetime'], - ); - - // Short representation of month in format? Some languages use different terms for the long and short format of May - if ((strpos($format, '\M') === false && strpos($format, 'M') !== false) || (strpos($format, '\r') === false && strpos($format, 'r') !== false)) - { - self::$format_cache[$lang][$format]['lang']['May'] = $user->lang['datetime']['May_short']; - } + self::$format_cache[$lang][$format]['lang']['May'] = $user->lang['datetime']['May_short']; } } |
