From fcece850629e1ba114d7b028e4ef8b0edd9a28e7 Mon Sep 17 00:00:00 2001 From: "monte.ohrt" Date: Thu, 24 Jul 2014 15:08:32 +0000 Subject: [PATCH] fix issue where cache dir does not exist -This line, and those below, will be ignored-- M distribution/libs/sysplugins/smarty_internal_cacheresource_file.php --- libs/sysplugins/smarty_internal_cacheresource_file.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/sysplugins/smarty_internal_cacheresource_file.php b/libs/sysplugins/smarty_internal_cacheresource_file.php index 17c6e4bf..b8e99cc6 100644 --- a/libs/sysplugins/smarty_internal_cacheresource_file.php +++ b/libs/sysplugins/smarty_internal_cacheresource_file.php @@ -147,7 +147,10 @@ class Smarty_Internal_CacheResource_File extends Smarty_CacheResource $_compile_id = isset($compile_id) ? preg_replace('![^\w\|]+!', '_', $compile_id) : null; $_dir_sep = $smarty->use_sub_dirs ? '/' : '^'; $_compile_id_offset = $smarty->use_sub_dirs ? 3 : 0; - $_dir = realpath($smarty->getCacheDir()) . '/'; + if (($_dir = realpath($smarty->getCacheDir())) === false) { + return 0; + } + $_dir .= '/'; $_dir_length = strlen($_dir); if (isset($_cache_id)) { $_cache_id_parts = explode('|', $_cache_id);