From dcfee3d1e8692f0010fc49bd2ae6fd63c87a68c8 Mon Sep 17 00:00:00 2001 From: mohrt Date: Tue, 30 Aug 2005 16:24:22 +0000 Subject: [PATCH] add char_set param --- NEWS | 1 + libs/plugins/modifier.escape.php | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 889700c9..3780c704 100644 --- a/NEWS +++ b/NEWS @@ -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) diff --git a/libs/plugins/modifier.escape.php b/libs/plugins/modifier.escape.php index 98e16e79..1dae7c02 100644 --- a/libs/plugins/modifier.escape.php +++ b/libs/plugins/modifier.escape.php @@ -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);