aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhubaishan <saeed@hubaishan.com>2017-11-08 09:31:47 +0300
committerMarc Alexander <admin@m-a-styles.de>2017-12-24 10:31:30 +0100
commit34d52a131b3422f6dc803ec2f46cfd5d0d8892c5 (patch)
treed7930e616d5bb23281a0c141b9700749d0657514
parentMerge pull request #5002 from JoshyPHP/ticket/15408 (diff)
downloadphpbb-34d52a131b3422f6dc803ec2f46cfd5d0d8892c5.tar.gz
phpbb-34d52a131b3422f6dc803ec2f46cfd5d0d8892c5.tar.bz2
phpbb-34d52a131b3422f6dc803ec2f46cfd5d0d8892c5.zip
[ticket/14857] Throw `S` from dateformat for non English languages
Throw `S` (ordinal suffix) from dateformat for non English languages PHPBB3-14857
-rw-r--r--phpBB/phpbb/datetime.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/phpBB/phpbb/datetime.php b/phpBB/phpbb/datetime.php
index 63cdba90fd..4b799b6219 100644
--- a/phpBB/phpbb/datetime.php
+++ b/phpBB/phpbb/datetime.php
@@ -60,6 +60,12 @@ class datetime extends \DateTime
public function format($format = '', $force_absolute = false)
{
$format = $format ? $format : $this->user->date_format;
+
+ if (substr($this->user->lang_name, 0,2) != 'en')
+ {
+ $format = preg_replace('/([^\\\])S/','$1', $format);
+ }
+
$format = self::format_cache($format, $this->user);
$relative = ($format['is_short'] && !$force_absolute);
$now = new self($this->user, 'now', $this->user->timezone);