From beedf081ab9724b0bc13b64fc2d90c6cd5d7404e Mon Sep 17 00:00:00 2001 From: Nick Liu Date: Thu, 23 Jan 2020 09:42:46 +0100 Subject: [PATCH] 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(). --- e107_handlers/Shims/Internal/StrptimeTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e107_handlers/Shims/Internal/StrptimeTrait.php b/e107_handlers/Shims/Internal/StrptimeTrait.php index efbda49f9..cda1c74a5 100644 --- a/e107_handlers/Shims/Internal/StrptimeTrait.php +++ b/e107_handlers/Shims/Internal/StrptimeTrait.php @@ -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);