[ticket/10931] Correctly handle inputs such as '-k' as invalid in get_bytes().

PHPBB3-10931
This commit is contained in:
Andreas Fischer 2012-06-11 15:06:52 +02:00
parent 44287e57bf
commit e9348b172a

View file

@ -137,10 +137,17 @@ class phpbb_php_ini
if (is_numeric($value))
{
// Already in bytes.
return $value;
}
else if (strlen($value) < 2)
{
// Single character.
return false;
}
else if (strlen($value) < 3 && $value[0] === '-')
{
// Two characters but the first one is a minus.
return false;
}