mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 19:04:27 +02:00
added modifier unescape:"url", fix (Forum Topic 20980)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
06.02.2012
|
||||
- improvement stream_resolve_include_path() added to Smarty_Internal_Get_Include_Path (Forum Topic 20980)
|
||||
- bugfix fetch('extends:foo.tpl') always yielded $source->exists == true (Forum Topic 20980)
|
||||
- added modifier unescape:"url", fix (Forum Topic 20980)
|
||||
|
||||
30.01.2012
|
||||
- bugfix Smarty_Security internal $_resource_dir cache wasn't properly propagated
|
||||
|
@@ -30,16 +30,19 @@ function smarty_modifiercompiler_unescape($params, $compiler)
|
||||
|
||||
switch (trim($params[1], '"\'')) {
|
||||
case 'entity':
|
||||
return 'mb_convert_encoding(' . $params[0] . ', ' . $params[2] . ', \'HTML-ENTITIES\')';
|
||||
case 'htmlall':
|
||||
if (Smarty::$_MBSTRING) {
|
||||
return 'mb_convert_encoding(' . $params[0] . ', ' . $params[2] . ', \'HTML-ENTITIES\')';
|
||||
}
|
||||
return 'html_entity_decode(' . $params[0] . ', ENT_QUOTES, ' . $params[2] . ')';
|
||||
|
||||
return 'html_entity_decode(' . $params[0] . ', ENT_NOQUOTES, ' . $params[2] . ')';
|
||||
|
||||
case 'html':
|
||||
return 'htmlspecialchars_decode(' . $params[0] . ', ENT_QUOTES)';
|
||||
|
||||
case 'url':
|
||||
return 'rawurldecode(' . $params[0] . ')';
|
||||
|
||||
default:
|
||||
return $params[0];
|
||||
}
|
||||
|
Reference in New Issue
Block a user