aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/smarty/smarty/libs/plugins/modifiercompiler.unescape.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/smarty/smarty/libs/plugins/modifiercompiler.unescape.php')
-rw-r--r--vendor/smarty/smarty/libs/plugins/modifiercompiler.unescape.php22
1 files changed, 15 insertions, 7 deletions
diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.unescape.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.unescape.php
index 05beb81f5..3438fe3e0 100644
--- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.unescape.php
+++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.unescape.php
@@ -14,20 +14,28 @@
* @author Rodney Rehm
*
* @param array $params parameters
+ * @param Smarty_Internal_TemplateCompilerBase $compiler
*
* @return string with compiled code
*/
-function smarty_modifiercompiler_unescape($params)
+function smarty_modifiercompiler_unescape($params, Smarty_Internal_TemplateCompilerBase $compiler)
{
- if (!isset($params[ 1 ])) {
- $params[ 1 ] = 'html';
- }
+ $compiler->template->_checkPlugins(
+ array(
+ array(
+ 'function' => 'smarty_literal_compiler_param',
+ 'file' => SMARTY_PLUGINS_DIR . 'shared.literal_compiler_param.php'
+ )
+ )
+ );
+
+ $esc_type = smarty_literal_compiler_param($params, 1, 'html');
+
if (!isset($params[ 2 ])) {
$params[ 2 ] = '\'' . addslashes(Smarty::$_CHARSET) . '\'';
- } else {
- $params[ 2 ] = "'{$params[ 2 ]}'";
}
- switch (trim($params[ 1 ], '"\'')) {
+
+ switch ($esc_type) {
case 'entity':
case 'htmlall':
if (Smarty::$_MBSTRING) {