mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-01 04:41:37 +01:00
add char_set param
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user