1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-04-25 10:05:21 +02:00

[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
This commit is contained in:
Andreas Fischer 2013-02-23 11:06:48 +01:00
parent 42b211a4a1
commit ae3a22bd0c

View File

@ -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