From 8e2d2492338229e0cef08290ebdea4d48753f3ad Mon Sep 17 00:00:00 2001 From: "Uwe.Tews@googlemail.com" Date: Thu, 25 Apr 2013 15:20:13 +0000 Subject: [PATCH] - bugfix escape and wordrap modifier could be compiled into wrong code when used in {nocache}{/nocache} section but caching is disabled (Forum Topic 24260) --- change_log.txt | 4 ++++ libs/plugins/modifiercompiler.escape.php | 2 +- libs/plugins/modifiercompiler.wordwrap.php | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/change_log.txt b/change_log.txt index 36e91cc5..60f5ec6b 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,8 @@ ===== trunk ===== +25.04.2013 +- bugfix escape and wordrap modifier could be compiled into wrong code when used in {nocache}{/nocache} + section but caching is disabled (Forum Topic 24260) + 05.04.2013 - bugfix post filter must not run when compiling inheritance child blocks (Forum Topic 24094) - bugfix after the fix for Issue #130 compiler exceptions got double escaped (Forum Topic 24199) diff --git a/libs/plugins/modifiercompiler.escape.php b/libs/plugins/modifiercompiler.escape.php index f50028bd..f5b4f433 100644 --- a/libs/plugins/modifiercompiler.escape.php +++ b/libs/plugins/modifiercompiler.escape.php @@ -112,7 +112,7 @@ function smarty_modifiercompiler_escape($params, $compiler) } // could not optimize |escape call, so fallback to regular plugin - if ($compiler->tag_nocache | $compiler->nocache) { + if ($compiler->template->caching && ($compiler->tag_nocache | $compiler->nocache)) { $compiler->template->required_plugins['nocache']['escape']['modifier']['file'] = SMARTY_PLUGINS_DIR .'modifier.escape.php'; $compiler->template->required_plugins['nocache']['escape']['modifier']['function'] = 'smarty_modifier_escape'; } else { diff --git a/libs/plugins/modifiercompiler.wordwrap.php b/libs/plugins/modifiercompiler.wordwrap.php index f6845ad3..9f21e224 100644 --- a/libs/plugins/modifiercompiler.wordwrap.php +++ b/libs/plugins/modifiercompiler.wordwrap.php @@ -31,7 +31,7 @@ function smarty_modifiercompiler_wordwrap($params, $compiler) } $function = 'wordwrap'; if (Smarty::$_MBSTRING) { - if ($compiler->tag_nocache | $compiler->nocache) { + if ($compiler->template->caching && ($compiler->tag_nocache | $compiler->nocache)) { $compiler->template->required_plugins['nocache']['wordwrap']['modifier']['file'] = SMARTY_PLUGINS_DIR .'shared.mb_wordwrap.php'; $compiler->template->required_plugins['nocache']['wordwrap']['modifier']['function'] = 'smarty_mb_wordwrap'; } else {