diff --git a/lib/front/front.class.php b/lib/front/front.class.php index c34d1c2ba6..c3d46ed770 100644 --- a/lib/front/front.class.php +++ b/lib/front/front.class.php @@ -777,23 +777,27 @@ EOT; * * @param string $key * @param mix $value - * @param string $type string|json|number * @static * @access public * @return void */ - static public function set($key, $value, $type = 'string') + static public function set($key, $value) { $js = self::start(false); - if($type == 'json') + if(is_array($value) or is_object($value)) { $value = json_encode($value); $js .= "$key = $value"; } - elseif($type == 'number') + elseif(is_numeric($value)) { $js .= "$key = $value"; } + elseif(is_bool($value)) + { + $value = $value ? 'true' : 'false'; + $js .= "$key = $value"; + } else { $value = addslashes($value);