[ticket/10931] Apply strtolower() correctly, i.e. not on false.

PHPBB3-10931
This commit is contained in:
Andreas Fischer 2012-06-11 15:45:30 +02:00
parent 72212077eb
commit 4468847107

View file

@ -67,9 +67,9 @@ class phpbb_php_ini
*/ */
public function get_bool($varname) public function get_bool($varname)
{ {
$value = strtolower($this->get_string($varname)); $value = $this->get_string($varname);
if (empty($value) || $value == 'off') if (empty($value) || strtolower($value) == 'off')
{ {
return false; return false;
} }
@ -128,7 +128,7 @@ class phpbb_php_ini
*/ */
public function get_bytes($varname) public function get_bytes($varname)
{ {
$value = strtolower($this->get_string($varname)); $value = $this->get_string($varname);
if ($value === false) if ($value === false)
{ {
@ -151,9 +151,10 @@ class phpbb_php_ini
return false; return false;
} }
$value_lower = strtolower($value);
$value_numeric = phpbb_to_numeric($value); $value_numeric = phpbb_to_numeric($value);
switch ($value[strlen($value) - 1]) switch ($value_lower[strlen($value_lower) - 1])
{ {
case 'g': case 'g':
$value_numeric *= 1024; $value_numeric *= 1024;