diff --git a/libs/core/core.process_compiled_include.php b/libs/core/core.process_compiled_include.php index 1482dc35..486636f4 100644 --- a/libs/core/core.process_compiled_include.php +++ b/libs/core/core.process_compiled_include.php @@ -18,7 +18,6 @@ function smarty_core_process_compiled_include($params, &$smarty) { $_return = $params['results']; foreach ($smarty->_cache_serials as $_include_file_path=>$_cache_serial) { - $smarty->smarty_include($_include_file_path, true); $_return = preg_replace_callback('!(\{nocache\:('.$_cache_serial.')#(\d+)\})!s', array(&$smarty, '_process_compiled_include_callback'), $_return); diff --git a/libs/core/core.read_cache_file.php b/libs/core/core.read_cache_file.php index 0f2e46ac..4f0acace 100644 --- a/libs/core/core.read_cache_file.php +++ b/libs/core/core.read_cache_file.php @@ -91,9 +91,16 @@ function smarty_core_read_cache_file(&$params, &$smarty) } } - $smarty->_cache_serials = array_merge($smarty->_cache_serials, - $smarty->_cache_info['cache_serials']); - + foreach ($smarty->_cache_info['cache_serials'] as $_include_file_path=>$_cache_serial) { + if (empty($smarty->_cache_serials[$_include_file_path])) { + $smarty->smarty_include($_include_file_path, true); + } + + if ($smarty->_cache_serials[$_include_file_path] != $_cache_serial) { + /* regenerate */ + return false; + } + } $params['results'] = $cache_split[1]; $content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']] = array($params['results'], $smarty->_cache_info);