From 3f1dbb8bc67b578266ca679e572eca0c90a23876 Mon Sep 17 00:00:00 2001 From: Denis Demesmaeker Date: Wed, 17 Oct 2007 09:30:13 +0000 Subject: always handle value as string so in_array(7, array(0=>'7fd8611a153c3770f02f13867aefc115') stays false --- it_html.class | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'it_html.class') diff --git a/it_html.class b/it_html.class index 4f1e837..9008b3e 100644 --- a/it_html.class +++ b/it_html.class @@ -354,11 +354,11 @@ function select($tags, $options, $selected = null) { $grouphtml = ""; foreach($option as $optval => $opt) - $grouphtml .= $this->_tag("option", array(array('value' => $optval, 'selected' => in_array($optval, $selected)), Q($opt))); + $grouphtml .= $this->_tag("option", array(array('value' => $optval, 'selected' => in_array((string)$optval, $selected)), Q($opt))); $html .= $this->_tag("optgroup", array(array('label' => $value, $grouphtml))); } else - $html .= $this->_tag("option", array(array('value' => $value, 'selected' => in_array($value, $selected), 'disabled' => $option === ""), (trim($option) === "") ? " " : Q($option))); + $html .= $this->_tag("option", array(array('value' => $value, 'selected' => in_array((string)$value, $selected), 'disabled' => $option === ""), (trim($option) === "") ? " " : Q($option))); } return $this->_tag("select", array($tags, $html)); -- cgit v1.2.3