1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 20:30:39 +02:00

Fix infinite recursion in compatibility strptime() for Windows

\e107\Shims\Internal\InternalTrait::strptime() now tries to run the internal PHP strptime()
function first instead of what's defined, which should defend against accidental infinite
recursion if something else like ./e107_handlers/php_compatibility_handler.php declares
strptime() and calls eShims::strptime().
This commit is contained in:
Nick Liu
2020-01-23 09:42:46 +01:00
parent 3fd23555a8
commit beedf081ab

View File

@@ -37,7 +37,7 @@ trait StrptimeTrait
public static function strptime($date, $format)
{
$result = false;
if (function_exists('strptime'))
if (function_exists('strptime') && (new \ReflectionFunction('strptime'))->isInternal())
$result = strptime($date, $format);
if (!is_array($result))
$result = self::strptime_alt($date, $format);