diff --git a/change_log.txt b/change_log.txt index 24689fa4..a7dc1a18 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== trunk ===== +01.11.2012 +- bugfix muteExcpetedErrors() would screw up for non-readable paths (Issue #118) + ===== Smarty-3.1.12 ===== 14.09.2012 - bugfix template inheritance failed to compile with delimiters {/ and /} (Forum Topic 23008) diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 54649927..ccececae 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -1392,10 +1392,12 @@ class Smarty extends Smarty_Internal_TemplateBase { // add the SMARTY_DIR to the list of muted directories if (!isset(Smarty::$_muted_directories[SMARTY_DIR])) { $smarty_dir = realpath(SMARTY_DIR); - Smarty::$_muted_directories[SMARTY_DIR] = array( - 'file' => $smarty_dir, - 'length' => strlen($smarty_dir), - ); + if ($smarty_dir !== false) { + Smarty::$_muted_directories[SMARTY_DIR] = array( + 'file' => $smarty_dir, + 'length' => strlen($smarty_dir), + ); + } } // walk the muted directories and test against $errfile @@ -1403,6 +1405,11 @@ class Smarty extends Smarty_Internal_TemplateBase { if (!$dir) { // resolve directory and length for speedy comparisons $file = realpath($key); + if ($file === false) { + // this directory does not exist, remove and skip it + unset(Smarty::$_muted_directories[$key]); + continue; + } $dir = array( 'file' => $file, 'length' => strlen($file),