fix: cut bytestring into numeric part

This commit is contained in:
Marvin Flock
2025-03-10 19:38:10 +01:00
parent d4c7bbc183
commit b776cea826
@@ -116,20 +116,19 @@ function setMinMemoryLimit($memDestSize) {
}
function getBytes($val) {
if (is_numeric($val)) {
$val = trim($val);
$numeric = substr($val, 0, strlen($val) -1);
$last = strtolower($val[strlen($val) - 1]);
switch ($last) {
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){