diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-02 15:46:03 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-02 15:46:03 +0000 |
commit | 926e6b17a34c06ce52852324121f1fd4d89e2a30 (patch) | |
tree | ef4cc38beb7354408e820a4bea20425ee149df74 /engine/lib | |
parent | 8bb6d8ccc07fccc14bf0404ffd4190b69a658c48 (diff) | |
download | elgg-926e6b17a34c06ce52852324121f1fd4d89e2a30.tar.gz elgg-926e6b17a34c06ce52852324121f1fd4d89e2a30.tar.bz2 |
Better code and docs or previous.
git-svn-id: http://code.elgg.org/elgg/trunk@7502 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/elgglib.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 70ac9d25b..f41e5fd6a 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -1943,18 +1943,19 @@ $sort_type = SORT_LOCALE_STRING) { } /** - * Return the state of a php.ini setting. + * Return the state of a php.ini setting as a bool * - * Normalizes the setting to bool. + * @warning Using this on ini settings that are not boolean + * will be inaccurate! * * @param string $ini_get_arg The INI setting * * @return true|false Depending on whether it's on or off */ function ini_get_bool($ini_get_arg) { - $temp = ini_get($ini_get_arg); + $temp = strtolower(ini_get($ini_get_arg)); - if ($temp == '1' or strtolower($temp) == 'on' or strtolower($temp) == 'true') { + if ($temp == '1' || $temp == 'on' || $temp == 'true') { return true; } return false; |