1
0

integrate Smarty 3.1.22-dev fix to clearCompiledTemplate() to avoid purging a wrong directory fallback on dir permission issues

7a1df12afa
This commit is contained in:
Ian
2015-01-21 11:36:00 +01:00
parent f2e7f6b2a0
commit ef90f8e157

View File

@ -191,7 +191,10 @@ class Smarty_Internal_Utility
*/ */
public static function clearCompiledTemplate($resource_name, $compile_id, $exp_time, Smarty $smarty) 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; $_compile_id = isset($compile_id) ? preg_replace('![^\w\|]+!', '_', $compile_id) : null;
$_dir_sep = $smarty->use_sub_dirs ? '/' : '^'; $_dir_sep = $smarty->use_sub_dirs ? '/' : '^';
if (isset($resource_name)) { if (isset($resource_name)) {