From ef90f8e157b00aaef090f8acf3d3ffd906a0fca9 Mon Sep 17 00:00:00 2001 From: Ian Date: Wed, 21 Jan 2015 11:36:00 +0100 Subject: [PATCH] integrate Smarty 3.1.22-dev fix to clearCompiledTemplate() to avoid purging a wrong directory fallback on dir permission issues https://github.com/smarty-php/smarty/commit/7a1df12afa7e1c83e3529d89c38e97feea6f0bf7 --- .../Smarty/libs/sysplugins/smarty_internal_utility.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bundled-libs/Smarty/libs/sysplugins/smarty_internal_utility.php b/bundled-libs/Smarty/libs/sysplugins/smarty_internal_utility.php index 0a5975bb..723b670f 100644 --- a/bundled-libs/Smarty/libs/sysplugins/smarty_internal_utility.php +++ b/bundled-libs/Smarty/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)) {