Skip to content

Commit

Permalink
- bugfix the source uid of the extendsall resource must contain $temp…
Browse files Browse the repository at this point in the history
…late_dir settings #123
  • Loading branch information
uwetews committed Dec 20, 2015
1 parent 78243be commit 3548de5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions change_log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- bugfix failure when the default resource type was set to 'extendsall' https://github.com/smarty-php/smarty/issues/123
- update compilation of Smarty special variables
- bugfix add addition check for OS type on normalizaition of file path https://github.com/smarty-php/smarty/issues/134
- bugfix the source uid of the extendsall resource must contain $template_dir settings https://github.com/smarty-php/smarty/issues/123

19.12.2015
- bugfix using $smarty.capture.foo in expressions could fail https://github.com/smarty-php/smarty/pull/138
Expand Down
16 changes: 10 additions & 6 deletions demo/plugins/resource.extendsall.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ public function populate(Smarty_Template_Source $source, Smarty_Internal_Templat
$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) {
Expand All @@ -38,7 +38,9 @@ public function populate(Smarty_Template_Source $source, Smarty_Internal_Templat

if (!$sources) {
$source->exists = false;
return;
$source->template = $_template;

return;
}

$sources = array_reverse($sources, true);
Expand All @@ -47,10 +49,12 @@ public function populate(Smarty_Template_Source $source, Smarty_Internal_Templat

$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;
}
}
2 changes: 1 addition & 1 deletion libs/Smarty.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/**
* smarty version
*/
const SMARTY_VERSION = '3.1.29-dev/16';
const SMARTY_VERSION = '3.1.29-dev/17';

/**
* define variable scopes
Expand Down

0 comments on commit 3548de5

Please sign in to comment.