From b71323ca2477f6ce71281408303ffc10feedcf06 Mon Sep 17 00:00:00 2001 From: rodneyrehm Date: Thu, 20 Oct 2011 12:50:12 +0000 Subject: [PATCH] - bugfix Smarty::clearCompiledTemplate() threw an Exception if $cache_id was not present in $compile_dir when $use_sub_dirs = true. -rewrote ClearCompiledTests to cover all possible usage scenarios --- change_log.txt | 1 + libs/sysplugins/smarty_internal_utility.php | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/change_log.txt b/change_log.txt index ce024609..3157a319 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,6 +1,7 @@ ===== trunk ===== 20.10.2011 - @silenced unlink() in Smarty_Internal_Write_File since debuggers go haywire without it. +- bugfix Smarty::clearCompiledTemplate() threw an Exception if $cache_id was not present in $compile_dir when $use_sub_dirs = true. 19.10.2011 - revert PHP4 constructor message diff --git a/libs/sysplugins/smarty_internal_utility.php b/libs/sysplugins/smarty_internal_utility.php index 2c184cd3..4f25719b 100644 --- a/libs/sysplugins/smarty_internal_utility.php +++ b/libs/sysplugins/smarty_internal_utility.php @@ -216,7 +216,11 @@ class Smarty_Internal_Utility { $_compile_id_part_length = strlen($_compile_id_part); } $_count = 0; - $_compileDirs = new RecursiveDirectoryIterator($_dir); + try { + $_compileDirs = new RecursiveDirectoryIterator($_dir); + } catch (UnexpectedValueException $e) { + return 0; + } $_compile = new RecursiveIteratorIterator($_compileDirs, RecursiveIteratorIterator::CHILD_FIRST); foreach ($_compile as $_file) { if (substr($_file->getBasename(), 0, 1) == '.' || strpos($_file, '.svn') !== false)