From: MarekBenjamin <117765478+MarekBenjamin@users.noreply.github.com> Date: Sat, 26 Nov 2022 22:14:21 +0000 (+0100) Subject: Update src/Util/Strings.php X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=765b50bde8cd2cb9e4f89fd67d81c1c1509b5261;p=friendica.git Update src/Util/Strings.php Co-authored-by: Hypolite Petovan --- diff --git a/src/Util/Strings.php b/src/Util/Strings.php index 7b8d999d3a..0972e44486 100644 --- a/src/Util/Strings.php +++ b/src/Util/Strings.php @@ -525,16 +525,16 @@ class Strings */ public static function getBytesFromShorthand(string $shorthand): int { - $shorthand = trim($shorthand); + $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 + $last = strtolower($shorthand[strlen($shorthand)-1]); + $shorthand = substr($shorthand, 0, -1); switch($last) { - // The 'G' modifier is available since PHP 5.1.0 case 'g': $shorthand *= 1024; case 'm':