php8: fix warnings during install procedure

(cherry picked from commit 48bae9d421)
This commit is contained in:
Mario
2021-03-03 12:39:41 +00:00
parent fbb1d6aa41
commit 3d264f5a55
9 changed files with 98 additions and 83 deletions

View File

@@ -52,17 +52,18 @@ function getPhpiniUploadLimits() {
*/
function phpiniSizeToBytes($val) {
$val = trim($val);
$num = (double)$val;
$unit = strtolower($val[strlen($val)-1]);
switch($unit) {
case 'g':
$val *= 1024;
$num *= 1024;
case 'm':
$val *= 1024;
$num *= 1024;
case 'k':
$val *= 1024;
$num *= 1024;
default:
break;
}
return (int)$val;
return (int)$num;
}