From 51570a5d08ea484f0d873817755054c50897bb74 Mon Sep 17 00:00:00 2001 From: Niek van der Kooy Date: Fri, 5 Aug 2016 20:54:59 +0200 Subject: [PATCH] Allow phpBytes to work with configs where gigabyte file sizes are allowed --- app/Support/Steam.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/Support/Steam.php b/app/Support/Steam.php index 3b2a140dc4..5158d2ab03 100644 --- a/app/Support/Steam.php +++ b/app/Support/Steam.php @@ -220,6 +220,13 @@ class Steam return intval($bytes); } + if (!(stripos($string, 'g') === false)) { + // has a G in it, remove the G and multiply by (1024)^3. + $bytes = bcmul(rtrim($string, 'gG'), '1073741824'); + + return intval($bytes); + } + return intval($string);