From c203e6c7be633c79955d89dff5cc8869c92e57f2 Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Fri, 22 Nov 2019 14:43:26 +0100 Subject: [PATCH] Fix utils::StartsWith when needle bigger that value --- application/utils.inc.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/application/utils.inc.php b/application/utils.inc.php index a4f7e0217..65e7cb467 100644 --- a/application/utils.inc.php +++ b/application/utils.inc.php @@ -2086,6 +2086,11 @@ class utils */ final public static function StartsWith($haystack, $needle) { + if (strlen($needle) > strlen($haystack)) + { + return false; + } + return substr_compare($haystack, $needle, 0, strlen($needle)) === 0; }