$return .= '&#' .
ord($string[$x]) . ';';
} return $return;
case 'javascript':
// escape quotes and backslashes, newlines, etc.
return strtr($string, array
('\\' => '\\\\', "'" => "\\'", '"' => '\\"', "\r" => '\\r', "\n" => '\\n', '</' => '<\/'
));
case 'mail':
if (Smarty::
$_MBSTRING) { require_once(SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php'
);
return smarty_mb_str_replace(array
('@', '.'
), array
(' [AT] ', ' [DOT] '
),
$string);
} // no MBString fallback
return str_replace(array
('@', '.'
), array
(' [AT] ', ' [DOT] '
),
$string);
case 'nonstd':
// escape non-standard chars, such as ms document quotes
$return = '';
if (Smarty::
$_MBSTRING) { require_once(SMARTY_PLUGINS_DIR . 'shared.mb_unicode.php'
);
foreach (smarty_mb_to_unicode($string, Smarty::
$_CHARSET) as $unicode) { if ($unicode >= 126
) {