]> git.mxchange.org Git - friendica.git/commitdiff
Fix Util Strings
authorArt4 <art4@wlabs.de>
Sun, 8 Dec 2024 22:20:20 +0000 (22:20 +0000)
committerArt4 <art4@wlabs.de>
Sun, 8 Dec 2024 22:20:20 +0000 (22:20 +0000)
src/Util/Strings.php

index 46d10529a94a06de3edc5ac184fda78ec15422ab..fbf691879ed45c23f684b193fbd68f772bde6387 100644 (file)
@@ -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]);