diff --git a/src/structure/components/com_sportsmanager/tools.php b/src/structure/components/com_sportsmanager/tools.php index 189687f..4e5efd9 100644 --- a/src/structure/components/com_sportsmanager/tools.php +++ b/src/structure/components/com_sportsmanager/tools.php @@ -116,20 +116,19 @@ function setMinMemoryLimit($memDestSize) { } function getBytes($val) { - if (is_numeric($val)) { $val = trim($val); - $last = strtolower($val[strlen($val) - 1]); - switch ($last) { + $numeric = substr($val, 0, strlen($val) -1); + $last = strtolower($val[strlen($val) - 1]); + switch($last) { // The 'G' modifier is available since PHP 5.1.0 case 'g': - $val *= 1024; + $numeric *= 1024; case 'm': - $val *= 1024; + $numeric *= 1024; case 'k': - $val *= 1024; - } - return $val; + $numeric *= 1024; } + return $numeric; } function encrypt($str, $key){