From edab07b69d7d02a35ce3d761d977f6245f5eb3e6 Mon Sep 17 00:00:00 2001 From: messju Date: Fri, 8 Jul 2005 18:11:22 +0000 Subject: [PATCH] fixed problems with cached templates containing nocache sections when they where displayed multiple times during a single request --- libs/internals/core.process_compiled_include.php | 5 +++++ libs/internals/core.read_cache_file.php | 10 ---------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/libs/internals/core.process_compiled_include.php b/libs/internals/core.process_compiled_include.php index 3e1d4c15..d539423b 100644 --- a/libs/internals/core.process_compiled_include.php +++ b/libs/internals/core.process_compiled_include.php @@ -20,6 +20,11 @@ function smarty_core_process_compiled_include($params, &$smarty) $smarty->_cache_including = true; $_return = $params['results']; + + foreach ($smarty->_cache_info['cache_serials'] as $_include_file_path=>$_cache_serial) { + $smarty->_include($_include_file_path, true); + } + foreach ($smarty->_cache_serials as $_include_file_path=>$_cache_serial) { $_return = preg_replace_callback('!(\{nocache\:('.$_cache_serial.')#(\d+)\})!s', array(&$smarty, '_process_compiled_include_callback'), diff --git a/libs/internals/core.read_cache_file.php b/libs/internals/core.read_cache_file.php index ecb14708..c60e113a 100644 --- a/libs/internals/core.read_cache_file.php +++ b/libs/internals/core.read_cache_file.php @@ -90,16 +90,6 @@ function smarty_core_read_cache_file(&$params, &$smarty) } } - foreach ($_cache_info['cache_serials'] as $_include_file_path=>$_cache_serial) { - if (empty($smarty->_cache_serials[$_include_file_path])) { - $smarty->_include($_include_file_path, true); - } - - if ($smarty->_cache_serials[$_include_file_path] != $_cache_serial) { - /* regenerate */ - return false; - } - } $content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']] = array($params['results'], $_cache_info); $smarty->_cache_info = $_cache_info;