mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 11:24:27 +02:00
add char_set param
This commit is contained in:
1
NEWS
1
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)
|
||||
|
@@ -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