- using multiple cwd with relative template dirs could result in identical compiled file names. (issue 194 and topic 25099)

This commit is contained in:
Uwe.Tews@googlemail.com
2014-06-02 19:56:38 +00:00
parent c7071d9d2c
commit 2c5ce49b97
4 changed files with 6 additions and 4 deletions

View File

@@ -104,7 +104,7 @@ class Smarty_Internal_Config
$_compile_id = isset($this->smarty->compile_id) ? preg_replace('![^\w\|]+!', '_', $this->smarty->compile_id) : null;
$_flag = (int) $this->smarty->config_read_hidden + (int) $this->smarty->config_booleanize * 2
+ (int) $this->smarty->config_overwrite * 4;
$_filepath = sha1($this->source->filepath . $_flag);
$_filepath = sha1(realpath($this->source->filepath) . $_flag);
// if use_sub_dirs, break file into directories
if ($this->smarty->use_sub_dirs) {
$_filepath = substr($_filepath, 0, 2) . DS

View File

@@ -50,7 +50,7 @@ class Smarty_Internal_Resource_Extends extends Smarty_Resource
}
$source->components = $sources;
$source->filepath = $s->filepath;
$source->uid = sha1($uid);
$source->uid = sha1(realpath($uid));
if ($_template && $_template->smarty->compile_check) {
$source->timestamp = $s->timestamp;
$source->exists = $exists;

View File

@@ -33,7 +33,7 @@ class Smarty_Internal_Resource_File extends Smarty_Resource
$source->smarty->security_policy->isTrustedResourceDir($source->filepath);
}
$source->uid = sha1($source->filepath);
$source->uid = sha1(realpath($source->filepath));
if ($source->smarty->compile_check && !isset($source->timestamp)) {
$source->timestamp = @filemtime($source->filepath);
$source->exists = !!$source->timestamp;