function cleanXSS($val, $nl2br = 0, $allowed_html_tags = '') { if (is_array($val)) { $val = $val[0]; } //?? do what? take only the first value $parser = new KHTMLParser($val, '', 1, $nl2br, $allowed_html_tags); $val = $parser->get_HTML(); return $val; }
function excerptHTML($params, $node) { global $CTX, $FUNCS; extract($FUNCS->get_named_vars(array('count' => '', 'ignore' => '', 'trail' => '…'), $params)); $count = $FUNCS->is_non_zero_natural($count) ? intval($count) : 50; if ($ignore != '') { $ignore = explode(",", $ignore); $ignore = array_map("trim", $ignore); } foreach ($node->children as $child) { $html .= $child->get_HTML(); } $arr = explode(' ', $html, $count + 1); if (count($arr) > $count) { $sep = $trail; $arr = array_slice($arr, 0, -1); } $html = implode(' ', $arr) . $sep; $parser = new KHTMLParser($html, $ignore); $html = $parser->get_HTML(); return $html; }