diff --git a/change_log.txt b/change_log.txt index e32f7d8e..8029c361 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,5 +1,8 @@  ===== 3.1.22-dev ===== (xx.xx.2015) + 20.01.2015 + - bugfix clearCompiledTemplates() could try to delete whole drive at wrong path permissions because realpath() fail (forum 25397) + 04.01.2015 - push last weeks changes to github diff --git a/libs/sysplugins/smarty_internal_utility.php b/libs/sysplugins/smarty_internal_utility.php index d5aa346d..af02b095 100644 --- a/libs/sysplugins/smarty_internal_utility.php +++ b/libs/sysplugins/smarty_internal_utility.php @@ -191,7 +191,10 @@ class Smarty_Internal_Utility */ public static function clearCompiledTemplate($resource_name, $compile_id, $exp_time, Smarty $smarty) { - $_compile_dir = realpath($smarty->getCompileDir()) . '/'; + if (($_compile_dir = realpath($smarty->getCompileDir())) === false) { + return 0; + } + $_compile_dir .= '/'; $_compile_id = isset($compile_id) ? preg_replace('![^\w\|]+!', '_', $compile_id) : null; $_dir_sep = $smarty->use_sub_dirs ? '/' : '^'; if (isset($resource_name)) {