function escape_html($string)
{
if (is_string($string)) {
- $transtbl = Array('<' => '<', '>' => '>', '"' => '"', '\'' => ''');
- return strtr($string, $transtbl);
+ return htmlspecialchars($string, ENT_QUOTES, 'UTF-8');
} else {
- return $string;
+ return $string;
}
}
function hide_emails($source, &$smarty)
{
+ if (!strpos($source, '@')) {
+ return $source;
+ }
+
//prevent email replacement in <script> and <textarea>
$tags = '(script|textarea|select)';
preg_match_all("!<$tags.*?>.*?</(\\1)>!ius", $source, $tagsmatches);