Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -1783,7 +1783,7 @@ |
1784 | 1784 | * for code that just takes the ini_get() return value as a boolean. |
1785 | 1785 | * |
1786 | 1786 | * To make things extra interesting, setting via php_value accepts |
1787 | | - * "true" as true, but php.ini and php_flag consider it false. :) |
| 1787 | + * "true" and "yes" as true, but php.ini and php_flag consider them false. :) |
1788 | 1788 | * Unrecognized values go false... again opposite PHP's own coercion |
1789 | 1789 | * from string to bool. |
1790 | 1790 | * |
— | — | @@ -1798,9 +1798,10 @@ |
1799 | 1799 | function wfIniGetBool( $setting ) { |
1800 | 1800 | $val = ini_get( $setting ); |
1801 | 1801 | // 'on' and 'true' can't have whitespace around them, but '1' can. |
1802 | | - return trim( $val ) == '1' |
1803 | | - || strtolower( $val ) == 'on' |
1804 | | - || strtolower( $val ) == 'true'; |
| 1802 | + return strtolower( $val ) == 'on' |
| 1803 | + || strtolower( $val ) == 'true' |
| 1804 | + || strtolower( $val ) == 'yes' |
| 1805 | + || preg_match( "/^\s*[+-]?0*[1-9]/", $val ); // approx C atoi() function |
1805 | 1806 | } |
1806 | 1807 | |
1807 | 1808 | /** |