1
0
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:
Nick Liu 2022-12-29 21:52:47 +01:00
parent 9abac0970b
commit cd5c94ecb4
No known key found for this signature in database
GPG Key ID: 1167C5F9C9897637

View File

@ -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));
}