From 515e84b96caca2b5642d9718e9d095a5357e3b5b Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 20 Dec 2010 20:57:35 +0000 Subject: [PATCH] hopefully last attempt to get correct handling of '0', 0 and '' (first should be treated equal, last not) --- phpgwapi/inc/class.html.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/class.html.inc.php b/phpgwapi/inc/class.html.inc.php index 3e9154df97..3b182133ef 100644 --- a/phpgwapi/inc/class.html.inc.php +++ b/phpgwapi/inc/class.html.inc.php @@ -412,7 +412,7 @@ class html $selected = $not_selected = array(); foreach($arr as $val => $label) { - if (in_array($val,$key,!$val)) + if (in_array((string)$val,$key)) { $selected[$val] = $label; } @@ -439,7 +439,7 @@ class html if (strlen($label) > $max_len) $max_len = strlen($label); - $html .= self::label(self::checkbox($name,in_array($val,$key,!$val),$val,$options_no_id. + $html .= self::label(self::checkbox($name,in_array((string)$val,$key),$val,$options_no_id. ' id="'.$base_name.'['.$val.']'.'"').self::htmlspecialchars($label), $base_name.'['.$val.']','',($title ? 'title="'.self::htmlspecialchars($title).'" ':''))."
\n"; }