mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 04:38:27 +01:00
eShims::strftime()
: Ensure callable from format map is a closure
Otherwise, one might encounter `is_callable("dd")` and a `function dd(…)` is defined, leading to that function being called instead of the string being used directly as the replacement.
This commit is contained in:
parent
9abac0970b
commit
cd5c94ecb4
@ -39,7 +39,7 @@ trait StrftimeTrait
|
||||
|
||||
foreach (self::getFormatMap() as $strftime_key => $date_format_key)
|
||||
{
|
||||
if (is_callable($date_format_key))
|
||||
if (!is_string($date_format_key) && is_callable($date_format_key))
|
||||
{
|
||||
$replacement = self::escapeDateTimePattern($date_format_key($datetime));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user