mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 05:07:27 +02: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:
@@ -39,7 +39,7 @@ trait StrftimeTrait
|
|||||||
|
|
||||||
foreach (self::getFormatMap() as $strftime_key => $date_format_key)
|
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));
|
$replacement = self::escapeDateTimePattern($date_format_key($datetime));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user