summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe.Tews@googlemail.com <Uwe.Tews@googlemail.com>2014-01-27 16:35:56 +0000
committerUwe.Tews@googlemail.com <Uwe.Tews@googlemail.com>2014-01-27 16:35:56 +0000
commitba2996fef584162bb82b6699c9b2acdb8405840c (patch)
treea7b6b54ca1f74086b0cbb87390d436941322a03c
parent79dfde49779ec47c1660cc4f41b766064bfdde5f (diff)
downloadsmarty-ba2996fef584162bb82b6699c9b2acdb8405840c.tar.gz
smarty-ba2996fef584162bb82b6699c9b2acdb8405840c.tar.bz2
smarty-ba2996fef584162bb82b6699c9b2acdb8405840c.zip
- bugfix clearCompiledTemplate(), clearAll() and clear() should use realpath to avoid possible exception from RecursiveDirectoryIterator (Issue 171)
-rw-r--r--change_log.txt1
-rw-r--r--libs/sysplugins/smarty_internal_cacheresource_file.php2
-rw-r--r--libs/sysplugins/smarty_internal_utility.php2
3 files changed, 3 insertions, 2 deletions
diff --git a/change_log.txt b/change_log.txt
index 3c3a7553..fe652892 100644
--- a/change_log.txt
+++ b/change_log.txt
@@ -1,6 +1,7 @@
===== trunk =====
27.01.2014
- bugfix $smarty->debugging = true; did show the variable of the $smarty object not the variables used in display() call (forum topic 24764)
+ - bugfix clearCompiledTemplate(), clearAll() and clear() should use realpath to avoid possible exception from RecursiveDirectoryIterator (Issue 171)
26.01.2014
- bugfix undo block nesting checks for {nocache} for reasons like forum topic 23280 (forum topic 24762)
diff --git a/libs/sysplugins/smarty_internal_cacheresource_file.php b/libs/sysplugins/smarty_internal_cacheresource_file.php
index 049cc91b..ad728340 100644
--- a/libs/sysplugins/smarty_internal_cacheresource_file.php
+++ b/libs/sysplugins/smarty_internal_cacheresource_file.php
@@ -139,7 +139,7 @@
$_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 = $smarty->getCacheDir();
+ $_dir = realpath($smarty->getCacheDir());
$_dir_length = strlen($_dir);
if (isset($_cache_id)) {
$_cache_id_parts = explode('|', $_cache_id);
diff --git a/libs/sysplugins/smarty_internal_utility.php b/libs/sysplugins/smarty_internal_utility.php
index 33091eaf..55509ded 100644
--- a/libs/sysplugins/smarty_internal_utility.php
+++ b/libs/sysplugins/smarty_internal_utility.php
@@ -182,7 +182,7 @@ class Smarty_Internal_Utility
*/
public static function clearCompiledTemplate($resource_name, $compile_id, $exp_time, Smarty $smarty)
{
- $_compile_dir = $smarty->getCompileDir();
+ $_compile_dir = realpath($smarty->getCompileDir());
$_compile_id = isset($compile_id) ? preg_replace('![^\w\|]+!', '_', $compile_id) : null;
$_dir_sep = $smarty->use_sub_dirs ? DS : '^';
if (isset($resource_name)) {