From 04d9c5cc34fadd19cd16096b8d8be34ac9e2a529 Mon Sep 17 00:00:00 2001 From: uwetews Date: Wed, 27 Jan 2016 00:35:04 +0100 Subject: [PATCH] - bugfix output filters did not observe nocache code flag https://github.com/smarty-php/smarty/issues/160 --- change_log.txt | 3 ++- libs/Smarty.class.php | 2 +- libs/sysplugins/smarty_internal_runtime_codeframe.php | 3 ++- libs/sysplugins/smarty_internal_runtime_updatecache.php | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/change_log.txt b/change_log.txt index 5dd221d9..230224bf 100644 --- a/change_log.txt +++ b/change_log.txt @@ -4,7 +4,8 @@ - bugfix {$smarty.section.customer.loop} did throw compiler error https://github.com/smarty-php/smarty/issues/161 update of yesterdays fix - bugfix string resource could inject code at {block} or inline subtemplates through PHP comments https://github.com/smarty-php/smarty/issues/157 - + - bugfix output filters did not observe nocache code flag https://github.com/smarty-php/smarty/issues/160 + 26.01.2016 - improvement observe Smarty::$_CHARSET in debugging console https://github.com/smarty-php/smarty/issues/169 - bugfix compiling {section} did create warning diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index d6a802aa..987993e1 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -121,7 +121,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.30-dev/22'; + const SMARTY_VERSION = '3.1.30-dev/23'; /** * define variable scopes diff --git a/libs/sysplugins/smarty_internal_runtime_codeframe.php b/libs/sysplugins/smarty_internal_runtime_codeframe.php index a3ef052e..0ba32124 100644 --- a/libs/sysplugins/smarty_internal_runtime_codeframe.php +++ b/libs/sysplugins/smarty_internal_runtime_codeframe.php @@ -29,16 +29,17 @@ class Smarty_Internal_Runtime_CodeFrame Smarty_Internal_TemplateCompilerBase $compiler = null) { // build property code - $properties[ 'has_nocache_code' ] = $_template->compiled->has_nocache_code; $properties[ 'version' ] = Smarty::SMARTY_VERSION; $properties[ 'unifunc' ] = 'content_' . str_replace(array('.', ','), '_', uniqid('', true)); if (!$cache) { + $properties[ 'has_nocache_code' ] = $_template->compiled->has_nocache_code; $properties[ 'file_dependency' ] = $_template->compiled->file_dependency; $properties[ 'includes' ] = $_template->compiled->includes; if (!empty($compiler->tpl_function)) { $properties[ 'tpl_function' ] = $compiler->tpl_function; } } else { + $properties[ 'has_nocache_code' ] = $_template->cached->has_nocache_code; $properties[ 'file_dependency' ] = $_template->cached->file_dependency; $properties[ 'cache_lifetime' ] = $_template->cache_lifetime; if (!empty($_template->tpl_function)) { diff --git a/libs/sysplugins/smarty_internal_runtime_updatecache.php b/libs/sysplugins/smarty_internal_runtime_updatecache.php index a895a307..77eaf361 100644 --- a/libs/sysplugins/smarty_internal_runtime_updatecache.php +++ b/libs/sysplugins/smarty_internal_runtime_updatecache.php @@ -61,7 +61,7 @@ class Smarty_Internal_Runtime_UpdateCache $content .= $cache_parts[1][$curr_idx]; } } - if (!$no_output_filter && !$_template->compiled->has_nocache_code && + if (!$no_output_filter && !$_template->cached->has_nocache_code && (isset($_template->smarty->autoload_filters['output']) || isset($_template->smarty->registered_filters['output'])) ) {