aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/session.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2013-02-23 11:06:48 +0100
committerAndreas Fischer <bantu@phpbb.com>2013-02-23 11:06:48 +0100
commitae3a22bd0c06bd6098c229963402d660572a0598 (patch)
treee60fc75297549674a81a045c7c26663b55eb74cf /phpBB/includes/session.php
parent42b211a4a19dc4e5c496d5f945f6df6109e2cc12 (diff)
downloadforums-ae3a22bd0c06bd6098c229963402d660572a0598.tar
forums-ae3a22bd0c06bd6098c229963402d660572a0598.tar.gz
forums-ae3a22bd0c06bd6098c229963402d660572a0598.tar.bz2
forums-ae3a22bd0c06bd6098c229963402d660572a0598.tar.xz
forums-ae3a22bd0c06bd6098c229963402d660572a0598.zip
[ticket/11361] Make sure that array passed to strtr() has the proper format.
The array $date_cache[$format]['lang'] passed to strtr() contains a sub-array which results in an E_NOTICE being thrown for 'Array to string conversion' on PHP 5.4. Ensure that the array passed to strtr() is one-dimensional by filtering out non-string values. PHPBB3-11361
Diffstat (limited to 'phpBB/includes/session.php')
-rw-r--r--phpBB/includes/session.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index d980f50e05..b93f2ff65e 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -2156,7 +2156,8 @@ class user extends session
'is_short' => strpos($format, '|'),
'format_short' => substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1),
'format_long' => str_replace('|', '', $format),
- 'lang' => $this->lang['datetime'],
+ // Filter out values that are not strings (e.g. arrays) for strtr().
+ 'lang' => array_filter($this->lang['datetime'], 'is_string'),
);
// Short representation of month in format? Some languages use different terms for the long and short format of May