summaryrefslogtreecommitdiff
path: root/demo
diff options
context:
space:
mode:
authoruwetews <uwe.tews@googlemail.com>2015-12-20 17:51:16 +0100
committeruwetews <uwe.tews@googlemail.com>2015-12-20 17:51:16 +0100
commit3548de5fa1482c487b982f5401b214811170e308 (patch)
tree976677cc48b7ec7d1ac9e821f2f9c02af63e4011 /demo
parent78243be722832ead4ef20ee7c67a661e0d0fb987 (diff)
downloadsmarty-3548de5fa1482c487b982f5401b214811170e308.tar.gz
smarty-3548de5fa1482c487b982f5401b214811170e308.tar.bz2
smarty-3548de5fa1482c487b982f5401b214811170e308.zip
- bugfix the source uid of the extendsall resource must contain $template_dir settings https://github.com/smarty-php/smarty/issues/123
Diffstat (limited to 'demo')
-rw-r--r--demo/plugins/resource.extendsall.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/demo/plugins/resource.extendsall.php b/demo/plugins/resource.extendsall.php
index f968b8dc..a6dd5e48 100644
--- a/demo/plugins/resource.extendsall.php
+++ b/demo/plugins/resource.extendsall.php
@@ -23,13 +23,13 @@ class Smarty_Resource_Extendsall extends Smarty_Internal_Resource_Extends
$uid = '';
$sources = array();
$exists = true;
- foreach ($source->smarty->getTemplateDir() as $key => $directory) {
+ foreach ($_template->smarty->getTemplateDir() as $key => $directory) {
try {
- $s = Smarty_Template_Source::load(null, $source->smarty, 'file:[' . $key . ']' . $source->name);
+ $s = Smarty_Resource::source(null, $source->smarty, 'file:' . '[' . $key . ']' . $source->name);
if (!$s->exists) {
continue;
}
- $sources[$s->uid] = $s;
+ $sources[ $s->uid ] = $s;
$uid .= $s->filepath;
}
catch (SmartyException $e) {
@@ -38,7 +38,9 @@ class Smarty_Resource_Extendsall extends Smarty_Internal_Resource_Extends
if (!$sources) {
$source->exists = false;
- return;
+ $source->template = $_template;
+
+ return;
}
$sources = array_reverse($sources, true);
@@ -47,10 +49,12 @@ class Smarty_Resource_Extendsall extends Smarty_Internal_Resource_Extends
$source->components = $sources;
$source->filepath = $s->filepath;
- $source->uid = sha1($uid);
+ $source->uid = sha1($uid . $_template->smarty->_joined_template_dir);
$source->exists = $exists;
if ($_template && $_template->smarty->compile_check) {
- $source->timestamp = $s->getTimeStamp();
+ $source->timestamp = $s->timestamp;
}
+ // need the template at getContent()
+ $source->template = $_template;
}
}