summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it_html.class9
1 files changed, 7 insertions, 2 deletions
diff --git a/it_html.class b/it_html.class
index 675e852..50223f4 100644
--- a/it_html.class
+++ b/it_html.class
@@ -366,16 +366,21 @@ function select($tags, $options, $selected = null)
{
$grouphtml = "";
foreach($option as $optval => $opt)
- $grouphtml .= $this->_tag("option", array(array('value' => $optval, 'selected' => in_array((string)$optval, $selected)), strip_tags(Q(strip_tags($opt)))));
+ $grouphtml .= $this->_tag("option", array(array('value' => $optval, 'selected' => in_array((string)$optval, $selected)), self::_strip_span(Q(self::_strip_span($opt)))));
$html .= $this->_tag("optgroup", array(array('label' => $value, $grouphtml)));
}
else
- $html .= $this->_tag("option", array(array('value' => $value, 'selected' => in_array((string)$value, $selected), 'disabled' => $option === ""), (trim($option) === "") ? " " : strip_tags(Q(strip_tags($option))))); # strip_tags removes .q debug param coloring
+ $html .= $this->_tag("option", array(array('value' => $value, 'selected' => in_array((string)$value, $selected), 'disabled' => $option === ""), (trim($option) === "") ? " " : self::_strip_span(Q(self::_strip_span($option))))); # self::_strip_span removes .q debug param coloring
}
return $this->_tag("select", array($tags, $html));
}
+# internal: strip spans added by debug params
+function _strip_span($html)
+{
+ return preg_replace('!</?span[^>]*>!', '', $html);
+}
/**
* Return HTML with all evil things stripped. Allowed are a coupld of simple