function hescape($string) { return htmlspecialchars(utf8_sanitize($string), ENT_QUOTES, 'UTF-8'); }
function clean_string($string, $quote_style = ENT_COMPAT) { $string = utf8_sanitize($string); return htmlspecialchars($string, $quote_style); }
function txt2html($str) { return htmlspecialchars(utf8_sanitize($str), ENT_QUOTES, 'UTF-8'); }
private function collect_script($node) { $children = $node->get_children(); $text = isset($children[0]) ? $children[0] : null; $code = ''; foreach ($children as $node) { $unsafe_code = $node->text_not_escaped(); $safe_code = utf8_sanitize($unsafe_code); $code .= $safe_code; } return $code; }