diff --git a/change_log.txt b/change_log.txt index fcbc02c5..24bbc016 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,3 +1,6 @@ +12/11/2009 +- bugfix on clear_compiled_tpl (avoid possible warning) + 12/10/2009 - bugfix on {function} tags and template inheritance diff --git a/libs/sysplugins/smarty_method_clear_compiled_tpl.php b/libs/sysplugins/smarty_method_clear_compiled_tpl.php index 260f042b..f57f985e 100644 --- a/libs/sysplugins/smarty_method_clear_compiled_tpl.php +++ b/libs/sysplugins/smarty_method_clear_compiled_tpl.php @@ -46,9 +46,9 @@ function Smarty_Method_Clear_Compiled_Tpl($smarty, $resource_name = null, $comp @rmdir($_file->getPathname()); } } else { - if ((!isset($_compile_id) || substr_compare((string)$_file, $_compile_id_part, 0, strlen($_compile_id_part)) == 0) && - (!isset($resource_name) || substr_compare((string)$_file, $_resource_part_1, - strlen($_resource_part_1), strlen($_resource_part_1)) == 0 || - substr_compare((string)$_file, $_resource_part_2, - strlen($_resource_part_2), strlen($_resource_part_2)) == 0)) { + if ((!isset($_compile_id) || (strlen((string)$_file) > strlen($_compile_id_part) && substr_compare((string)$_file, $_compile_id_part, 0, strlen($_compile_id_part)) == 0)) && + (!isset($resource_name) || (strlen((string)$_file) > strlen($_resource_part_1) && substr_compare((string)$_file, $_resource_part_1, - strlen($_resource_part_1), strlen($_resource_part_1)) == 0) || + (strlen((string)$_file) > strlen($_resource_part_2) && substr_compare((string)$_file, $_resource_part_2, - strlen($_resource_part_2), strlen($_resource_part_2)) == 0))) { if (isset($exp_time)) { if (time() - @filemtime($_file) >= $exp_time) { $_count += @unlink((string) $_file) ? 1 : 0;