added escape type "decentity" to smarty_modifier_escape()

This commit is contained in:
messju
2004-04-16 08:40:42 +00:00
parent 397714a96c
commit 20b4be1048
2 changed files with 9 additions and 0 deletions

2
NEWS
View File

@@ -1,3 +1,5 @@
- add case decentity to smarty_modifier_escape() (Konstantin A. Pelepelin,
messju)
- make smarty_core_write_compiled_include() php5-aware (messju)
- removed unused functionality to load a subset of lines from a file (messju)
- fix is_secure() should only check if a file is_readable, not if

View File

@@ -49,6 +49,13 @@ function smarty_modifier_escape($string, $esc_type = 'html')
}
return $return;
case 'decentity':
$return = '';
for ($x=0; $x < strlen($string); $x++) {
$return .= '&#' . ord($string[$x]) . ';';
}
return $return;
case 'javascript':
// escape quotes and backslashes and newlines
return strtr($string, array('\\'=>'\\\\',"'"=>"\\'",'"'=>'\\"',"\r"=>'\\r',"\n"=>'\\n'));