From 926e6b17a34c06ce52852324121f1fd4d89e2a30 Mon Sep 17 00:00:00 2001 From: brettp Date: Thu, 2 Dec 2010 15:46:03 +0000 Subject: Better code and docs or previous. git-svn-id: http://code.elgg.org/elgg/trunk@7502 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/elgglib.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'engine') 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; -- cgit v1.2.3