diff --git a/thirdparty/Smarty/plugins/modifier.sanitize.php b/thirdparty/Smarty/plugins/modifier.sanitize.php new file mode 100644 index 0000000..99ecaf9 --- /dev/null +++ b/thirdparty/Smarty/plugins/modifier.sanitize.php @@ -0,0 +1,71 @@ +'\\\\',"'"=>"\\'",'"'=>'\\"',"\r"=>'\\r',"\n"=>'\\n',''<\/')); + + case 'mail': + // safe way to display e-mail address on a web page + return str_replace(array('@', '.'),array(' [AT] ', ' [DOT] '), $string); + + case 'nonstd': + // escape non-standard chars, such as ms document quotes + $_res = ''; + for($_i = 0, $_len = strlen($string); $_i < $_len; $_i++) { + $_ord = ord($string{$_i}); + // non-standard char, escape it + if($_ord >= 126){ + $_res .= '&#' . $_ord . ';'; + } + else { + $_res .= $string{$_i}; + } + } + return $_res; + + default: + return $string; + } +} + + +?>