From 3cd098bfc7021e025df29dd16efa1beee43eb0e1 Mon Sep 17 00:00:00 2001 From: Art4 Date: Sun, 8 Dec 2024 22:20:20 +0000 Subject: [PATCH] Fix Util Strings --- src/Util/Strings.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Util/Strings.php b/src/Util/Strings.php index 46d10529a9..fbf691879e 100644 --- a/src/Util/Strings.php +++ b/src/Util/Strings.php @@ -530,8 +530,12 @@ class Strings { $shorthand = trim($shorthand); - if (is_numeric($shorthand)) { - return $shorthand; + if (ctype_digit($shorthand)) { + return (int) $shorthand; + } + + if ($shorthand === '') { + return 0; } $last = strtolower($shorthand[strlen($shorthand) - 1]);