- Affected version
- 2.2.8
So I mistyped my Units in my php.ini. I wrote 50MB, not 50M, but had to look through the source code until I realized what my error was. While looking I found this code that tries to fix this kind of mistake. But it can't handle this mistake, because $units will always be one character, in case of 50M it will be "M" and in case of 50MB it will be "B". In my personal opinion it would be nice if MB units generated a warning message.
xenforo/src/XF/Util/Php.php:456
xenforo/src/XF/Util/Php.php:456
PHP:
protected static function getBytesFromPhpConfigValue($configParam)
[...]
{
$units = strtoupper(substr($configValue, -1));
$value = intval($configValue);
// note that KB, MB and GB are not actually valid in PHP config, but are frequently encountered
switch ($units)
{
case 'K':
case 'KB':
return $value * 1024;
case 'M':
case 'MB':
return $value * 1048576;
case 'G':
case 'GB':
return $value * 1073741824;
default:
return $value;
}
}
}