add char_set param

This commit is contained in:
mohrt
2005-08-30 16:24:22 +00:00
parent c1eb728550
commit dcfee3d1e8
2 changed files with 4 additions and 3 deletions

1
NEWS
View File

@@ -1,3 +1,4 @@
- add char_set parameter to escape modifier (Loading, monte)
- fix notice in debug security check (Drakla, monte)
- return valid reference in get_template_vars() when given var is
non-existant (monte)

View File

@@ -18,14 +18,14 @@
* @param html|htmlall|url|quotes|hex|hexentity|javascript
* @return string
*/
function smarty_modifier_escape($string, $esc_type = 'html')
function smarty_modifier_escape($string, $esc_type = 'html', $char_set = 'UTF-8')
{
switch ($esc_type) {
case 'html':
return htmlspecialchars($string, ENT_QUOTES);
return htmlspecialchars($string, ENT_QUOTES, $char_set);
case 'htmlall':
return htmlentities($string, ENT_QUOTES);
return htmlentities($string, ENT_QUOTES, $char_set);
case 'url':
return rawurlencode($string);