mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
added escape type "decentity" to smarty_modifier_escape()
This commit is contained in:
2
NEWS
2
NEWS
@@ -1,3 +1,5 @@
|
|||||||
|
- add case decentity to smarty_modifier_escape() (Konstantin A. Pelepelin,
|
||||||
|
messju)
|
||||||
- make smarty_core_write_compiled_include() php5-aware (messju)
|
- make smarty_core_write_compiled_include() php5-aware (messju)
|
||||||
- removed unused functionality to load a subset of lines from a file (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
|
- fix is_secure() should only check if a file is_readable, not if
|
||||||
|
@@ -49,6 +49,13 @@ function smarty_modifier_escape($string, $esc_type = 'html')
|
|||||||
}
|
}
|
||||||
return $return;
|
return $return;
|
||||||
|
|
||||||
|
case 'decentity':
|
||||||
|
$return = '';
|
||||||
|
for ($x=0; $x < strlen($string); $x++) {
|
||||||
|
$return .= '&#' . ord($string[$x]) . ';';
|
||||||
|
}
|
||||||
|
return $return;
|
||||||
|
|
||||||
case 'javascript':
|
case 'javascript':
|
||||||
// escape quotes and backslashes and newlines
|
// escape quotes and backslashes and newlines
|
||||||
return strtr($string, array('\\'=>'\\\\',"'"=>"\\'",'"'=>'\\"',"\r"=>'\\r',"\n"=>'\\n'));
|
return strtr($string, array('\\'=>'\\\\',"'"=>"\\'",'"'=>'\\"',"\r"=>'\\r',"\n"=>'\\n'));
|
||||||
|
Reference in New Issue
Block a user