From 9d34e78d0b0c3e9429bc01c565fd8a3984d64e25 Mon Sep 17 00:00:00 2001 From: "uwe.tews@googlemail.com" Date: Fri, 17 Aug 2012 11:19:16 +0000 Subject: [PATCH] 17.08.2012 - bugfix compiled code of nocache sections could contain wrong escaping (Forum Topic 22810) --- change_log.txt | 3 +++ libs/sysplugins/smarty_internal_templatecompilerbase.php | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/change_log.txt b/change_log.txt index cf582650..c7f3cf07 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== trunk ===== +17.08.2012 +- bugfix compiled code of nocache sections could contain wrong escaping (Forum Topic 22810) + 15.08.2012 - bugfix template inheritance did produce wrong code if subtemplates with {block} was included several times (from smarty-developers forum) diff --git a/libs/sysplugins/smarty_internal_templatecompilerbase.php b/libs/sysplugins/smarty_internal_templatecompilerbase.php index bd9de418..5eeb8ef6 100644 --- a/libs/sysplugins/smarty_internal_templatecompilerbase.php +++ b/libs/sysplugins/smarty_internal_templatecompilerbase.php @@ -594,8 +594,7 @@ abstract class Smarty_Internal_TemplateCompilerBase { if ((!($this->template->source->recompiled) || $this->forceNocache) && $this->template->caching && !$this->suppressNocacheProcessing && ($this->nocache || $this->tag_nocache || $this->forceNocache == 2)) { $this->template->has_nocache_code = true; - $_output = str_replace("'", "\'", $content); - $_output = str_replace('\\\\', '\\\\\\\\', $_output); + $_output = addcslashes($content,'\'\\'); $_output = str_replace("^#^", "'", $_output); $_output = "nocache_hash}%%*/" . $_output . "/*/%%SmartyNocache:{$this->nocache_hash}%%*/';?>\n"; // make sure we include modifer plugins for nocache code