Update src/Util/Strings.php

Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
This commit is contained in:
MarekBenjamin 2022-11-26 23:14:21 +01:00 committed by GitHub
parent ce56cabd9f
commit 765b50bde8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -527,14 +527,14 @@ class Strings
{
$shorthand = trim($shorthand);
if (is_numeric($shorthand))
if (is_numeric($shorthand)) {
return $shorthand;
}
$last = strtolower($shorthand[strlen($shorthand)-1]);
$shorthand = substr($shorthand, 0, -1); // necessary since PHP 7.1; otherwise optional
$shorthand = substr($shorthand, 0, -1);
switch($last) {
// The 'G' modifier is available since PHP 5.1.0
case 'g':
$shorthand *= 1024;
case 'm':