]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Better code and docs or previous.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 2 Dec 2010 15:46:03 +0000 (15:46 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 2 Dec 2010 15:46:03 +0000 (15:46 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7502 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/elgglib.php

index 70ac9d25b3c5ae66c4374469e457d811c62f96f4..f41e5fd6a0ca1d8635a2a66f177d32b2cc5b4083 100644 (file)
@@ -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;