Skip to content

Commit

Permalink
Fix #13303: use strtolower in ini_get_bool()
Browse files Browse the repository at this point in the history
Generally, ini_get() returns '0' or '1' when querying a boolean option,
regardless of the actual string used to set it (i.e. On, False, etc).
However, in some cases (e.g. when the option is set in httpd.conf
via php_admin_value instead of php_admin_flag), ini_get() returns the
string itself instead.

This caused ini_get_bool() to wrongly return False when the option is
set to an equivalent of True but with a different case ('On', 'TRUE').
  • Loading branch information
dregad committed Sep 14, 2011
1 parent aa3244a commit a666237
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/utility_api.php
Expand Up @@ -91,7 +91,7 @@ function ini_get_bool( $p_name ) {
$result = ini_get( $p_name );

if( is_string( $result ) ) {
switch( $result ) {
switch( strtolower( $result ) ) {
case 'off':
case 'false':
case 'no':
Expand Down

0 comments on commit a666237

Please sign in to comment.