2020-03-17, 22:43:22
replace basic.php tobytes() with the one from 3.4
PHP Code:
/**
* Convert to Bytes
* convert M/G/K byte string to bytes
* 100M returns 100*1024*1024
* @since 3.0
*
* @param $str string
* @return string
*/
function toBytes($str){
$val = trim($str, 'gmkGMK');
$last = strtolower($str[strlen($str)-1]);
switch($last) {
case 'g': $val *= 1024;
case 'm': $val *= 1024;
case 'k': $val *= 1024;
}
return $val;
}