mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/10931] Correctly handle inputs such as '-k' as invalid in get_bytes().
PHPBB3-10931
This commit is contained in:
parent
44287e57bf
commit
e9348b172a
1 changed files with 7 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue