diff --git a/change_log.txt b/change_log.txt index 529e8520..5a0d5816 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,3 +1,6 @@ +09/02/2010 +- avoid possible notice on $smarty->cache->clear(...), $smarty->clear_cache(....) + 09/02/2010 - added $smarty->_tag_stack for tracing block tag hierarchy diff --git a/libs/sysplugins/smarty_internal_cacheresource_file.php b/libs/sysplugins/smarty_internal_cacheresource_file.php index 445d9deb..57dcc00f 100644 --- a/libs/sysplugins/smarty_internal_cacheresource_file.php +++ b/libs/sysplugins/smarty_internal_cacheresource_file.php @@ -159,7 +159,7 @@ class Smarty_Internal_CacheResource_File { } } // check compile id - if (isset($_compile_id) && $_parts[$_parts_count-2 - $_compile_id_offset] != $_compile_id) { + if (isset($_compile_id) && (!isset($_parts[$_parts_count-2 - $_compile_id_offset]) || $_parts[$_parts_count-2 - $_compile_id_offset] != $_compile_id)) { continue; } // check cache id @@ -176,7 +176,7 @@ class Smarty_Internal_CacheResource_File { // expired ? if (isset($exp_time) && time() - @filemtime($_file) < $exp_time) { continue; - } + } $_count += @unlink((string) $_file) ? 1 : 0; } }