diff options
author | Urban Müller | 2012-03-15 17:37:45 +0000 |
---|---|---|
committer | Urban Müller | 2012-03-15 17:37:45 +0000 |
commit | 77e3c45d5b04e18c7dc83db65050b0407e578ad6 (patch) | |
tree | d406dd3eef2c5527511146ec33d7353e983c0623 /it_html.class | |
parent | 55e7242dd3ef6bfcbe37a6c6a4abe2f0557a81c8 (diff) | |
download | itools-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.class | 8 |
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) === "") ? " " : 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) === "") ? " " : 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); } /** |