diff --git a/NEWS b/NEWS index 573bcc75..d9cd6871 100644 --- a/NEWS +++ b/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) - 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 diff --git a/libs/plugins/modifier.escape.php b/libs/plugins/modifier.escape.php index b4979554..5bef8b43 100644 --- a/libs/plugins/modifier.escape.php +++ b/libs/plugins/modifier.escape.php @@ -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'));