added modifier unescape:"url", fix (Forum Topic 20980)

This commit is contained in:
rodneyrehm
2012-02-06 20:33:07 +00:00
parent 6d90cd3fd7
commit 0f39bdfd59
2 changed files with 6 additions and 2 deletions

View File

@@ -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

View File

@@ -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];
}