Using new ini_get_bool function to work around a bug with ini_get where

the result is different for items set in htaccess
This commit is contained in:
moodler 2003-05-17 02:05:10 +00:00
parent 785ae439eb
commit c39c66a5e8
3 changed files with 32 additions and 14 deletions

View file

@ -1226,6 +1226,21 @@ function check_browser_version($brand="MSIE", $version=5.5) {
return false;
}
function ini_get_bool($ini_get_arg) {
/// This function makes the return value of ini_get consistent if you are
/// setting server directives through the .htaccess file in apache.
/// Current behavior for value set from php.ini On = 1, Off = [blank]
/// Current behavior for value set from .htaccess On = On, Off = Off
/// Contributed by jdell@unr.edu
$temp = ini_get($ini_get_arg);
if ($temp == "1" or strtolower($temp) == "on") {
return true;
}
return false;
}
function can_use_richtext_editor() {
/// Is the richedit editor enabled?
global $USER, $CFG;