Fix Util Strings

This commit is contained in:
Art4 2024-12-08 22:20:20 +00:00
parent 020d1f6e30
commit 3cd098bfc7

View file

@ -530,8 +530,12 @@ class Strings
{ {
$shorthand = trim($shorthand); $shorthand = trim($shorthand);
if (is_numeric($shorthand)) { if (ctype_digit($shorthand)) {
return $shorthand; return (int) $shorthand;
}
if ($shorthand === '') {
return 0;
} }
$last = strtolower($shorthand[strlen($shorthand) - 1]); $last = strtolower($shorthand[strlen($shorthand) - 1]);