mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-04 07:47:34 +02:00
[ticket/10931] Correctly handle inputs such as '-k' as invalid in get_bytes().
PHPBB3-10931
This commit is contained in:
@@ -137,10 +137,17 @@ class phpbb_php_ini
|
|||||||
|
|
||||||
if (is_numeric($value))
|
if (is_numeric($value))
|
||||||
{
|
{
|
||||||
|
// Already in bytes.
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
else if (strlen($value) < 2)
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user