summaryrefslogtreecommitdiff
path: root/it_html.class
diff options
context:
space:
mode:
authorUrban Müller2012-03-15 17:37:45 +0000
committerUrban Müller2012-03-15 17:37:45 +0000
commit77e3c45d5b04e18c7dc83db65050b0407e578ad6 (patch)
treed406dd3eef2c5527511146ec33d7353e983c0623 /it_html.class
parent55e7242dd3ef6bfcbe37a6c6a4abe2f0557a81c8 (diff)
downloaditools-77e3c45d5b04e18c7dc83db65050b0407e578ad6.tar.gz
itools-77e3c45d5b04e18c7dc83db65050b0407e578ad6.tar.bz2
itools-77e3c45d5b04e18c7dc83db65050b0407e578ad6.zip
remove <a> tags from <option> (.texts. mode)
Diffstat (limited to 'it_html.class')
-rw-r--r--it_html.class8
1 files changed, 4 insertions, 4 deletions
diff --git a/it_html.class b/it_html.class
index ba80752..9203c98 100644
--- a/it_html.class
+++ b/it_html.class
@@ -388,20 +388,20 @@ 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)), self::_strip_span(Q(self::_strip_span($opt)))));
+ $grouphtml .= $this->_tag("option", array(array('value' => $optval, 'selected' => in_array((string)$optval, $selected)), self::_strip_tags(Q(self::_strip_tags($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) === "") ? "&nbsp;" : self::_strip_span(Q(self::_strip_span($option))))); # self::_strip_span removes .q debug param coloring
+ $html .= $this->_tag("option", array(array('value' => $value, 'selected' => in_array((string)$value, $selected), 'disabled' => $option === ""), (trim($option) === "") ? "&nbsp;" : self::_strip_tags(Q(self::_strip_tags($option))))); # self::_strip_tags removes .q debug param coloring
}
return $this->_tag("select", array($tags, $html));
}
# internal: strip spans added by debug params
-function _strip_span($html)
+function _strip_tags($html)
{
- return preg_replace('!</?span[^>]*>!', '', $html);
+ return preg_replace('!</?(span|a)\b[^>]*>!', '', $html);
}
/**