aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/php/ini.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2012-06-11 15:06:52 +0200
committerAndreas Fischer <bantu@phpbb.com>2012-06-11 15:06:52 +0200
commite9348b172a5b0661b26a8f3a0fe3368568539edb (patch)
treebbe5caeb7e0df6aa46ae33395150a134670a5207 /phpBB/includes/php/ini.php
parent44287e57bf9536bd91933347ad64f289ef2a0391 (diff)
downloadforums-e9348b172a5b0661b26a8f3a0fe3368568539edb.tar
forums-e9348b172a5b0661b26a8f3a0fe3368568539edb.tar.gz
forums-e9348b172a5b0661b26a8f3a0fe3368568539edb.tar.bz2
forums-e9348b172a5b0661b26a8f3a0fe3368568539edb.tar.xz
forums-e9348b172a5b0661b26a8f3a0fe3368568539edb.zip
[ticket/10931] Correctly handle inputs such as '-k' as invalid in get_bytes().
PHPBB3-10931
Diffstat (limited to 'phpBB/includes/php/ini.php')
-rw-r--r--phpBB/includes/php/ini.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/phpBB/includes/php/ini.php b/phpBB/includes/php/ini.php
index 882464275b..de1cb5096c 100644
--- a/phpBB/includes/php/ini.php
+++ b/phpBB/includes/php/ini.php
@@ -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;
}