From 9f5d8858359072b168855b6b6b3f2eb7d31d06d0 Mon Sep 17 00:00:00 2001 From: "Uwe.Tews" Date: Wed, 10 Feb 2010 18:00:41 +0000 Subject: [PATCH] - avoid possible notice on $smarty->cache->clear(...), $smarty->clear_cache(....) --- change_log.txt | 3 +++ libs/sysplugins/smarty_internal_cacheresource_file.php | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) 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; } }