aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2017-12-27 19:13:59 +0100
committerMarc Alexander <admin@m-a-styles.de>2017-12-27 19:13:59 +0100
commit8f662eac403584480692fa6e35aa42cf56aa09a0 (patch)
treef492479b3cc8aa4b0fce8ec9ff55ec486a9c1374
parent64dad1a362dda3aca137aacc3eff159d8dfddbee (diff)
parent34d52a131b3422f6dc803ec2f46cfd5d0d8892c5 (diff)
downloadforums-8f662eac403584480692fa6e35aa42cf56aa09a0.tar
forums-8f662eac403584480692fa6e35aa42cf56aa09a0.tar.gz
forums-8f662eac403584480692fa6e35aa42cf56aa09a0.tar.bz2
forums-8f662eac403584480692fa6e35aa42cf56aa09a0.tar.xz
forums-8f662eac403584480692fa6e35aa42cf56aa09a0.zip
Merge pull request #5037 from hubaishan/ticket/14857
[ticket/14857] Throw `S` from dateformat for non English languages
-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);