From 2fe15841436a7c4df201d3359522fb921c486c55 Mon Sep 17 00:00:00 2001 From: Andreas Hennings Date: Tue, 12 Nov 2024 23:00:55 +0100 Subject: [PATCH] Issue #56: Simplify strStartsWith(). --- src/Cool/CoolRequest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Cool/CoolRequest.php b/src/Cool/CoolRequest.php index d6217ece..2e56ed4b 100644 --- a/src/Cool/CoolRequest.php +++ b/src/Cool/CoolRequest.php @@ -80,8 +80,7 @@ function getWopiSrcUrl($discovery_parsed, $mimetype) { * @see str_starts_with() */ function strStartsWith($haystack, $needle) { - $pos = strrpos($haystack, $needle); - return !is_bool($pos) && $pos == 0; + return strrpos($haystack, $needle) === 0; } /**