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]);