From: Art4 Date: Sun, 8 Dec 2024 22:20:20 +0000 (+0000) Subject: Fix Util Strings X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3cd098bfc7021e025df29dd16efa1beee43eb0e1;p=friendica.git Fix Util Strings --- 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]);