summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe.Tews@googlemail.com <Uwe.Tews@googlemail.com>2014-04-06 18:50:39 +0000
committerUwe.Tews@googlemail.com <Uwe.Tews@googlemail.com>2014-04-06 18:50:39 +0000
commit668bc167178af7f281f2cd93acae370d184ebdf7 (patch)
treec333d14618bd3ae8ec1931aef1f8ba224e864c87
parent79d67afb0fd63bb2ada5c8f57190007a3f1da296 (diff)
downloadsmarty-668bc167178af7f281f2cd93acae370d184ebdf7.tar.gz
smarty-668bc167178af7f281f2cd93acae370d184ebdf7.tar.bz2
smarty-668bc167178af7f281f2cd93acae370d184ebdf7.zip
- bugfix template inheritance fail when using custom resource after patch of 8.3.2014 (Issue 187)
-rw-r--r--change_log.txt3
-rw-r--r--libs/sysplugins/smarty_internal_compile_block.php10
2 files changed, 10 insertions, 3 deletions
diff --git a/change_log.txt b/change_log.txt
index cf8094c9..7ce66e1e 100644
--- a/change_log.txt
+++ b/change_log.txt
@@ -1,4 +1,7 @@
===== trunk =====
+ 06.04.2014
+ - bugfix template inheritance fail when using custom resource after patch of 8.3.2014 (Issue 187)
+
05.04.2014
- bugfix default date format leads to extra spaces when displaying dates with single digit days (Issue 182)
diff --git a/libs/sysplugins/smarty_internal_compile_block.php b/libs/sysplugins/smarty_internal_compile_block.php
index 377288df..02546c0b 100644
--- a/libs/sysplugins/smarty_internal_compile_block.php
+++ b/libs/sysplugins/smarty_internal_compile_block.php
@@ -84,7 +84,7 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_CompileBase
$this->template->block_data[$_name]['source'] = '';
// build {block} for child block
self::$block_data[$_name]['source'] =
- "{$compiler->smarty->left_delimiter}private_child_block name={$_attr['name']} file='{$compiler->template->source->filepath}'" .
+ "{$compiler->smarty->left_delimiter}private_child_block name={$_attr['name']} file='{$compiler->template->source->filepath}' type='{$compiler->template->source->type}' resource='{$compiler->template->template_resource}'" .
" uid='{$compiler->template->source->uid}' line={$compiler->lex->line}";
if ($_attr['nocache']) {
self::$block_data[$_name]['source'] .= ' nocache';
@@ -361,7 +361,7 @@ class Smarty_Internal_Compile_Private_Child_Block extends Smarty_Internal_Compil
* @var array
* @see Smarty_Internal_CompileBase
*/
- public $required_attributes = array('name', 'file', 'uid', 'line');
+ public $required_attributes = array('name', 'file', 'uid', 'line', 'type', 'resource');
/**
@@ -377,7 +377,11 @@ class Smarty_Internal_Compile_Private_Child_Block extends Smarty_Internal_Compil
$_attr = $this->getAttributes($compiler, $args);
// update template with original template resource of {block}
- $compiler->template->template_resource = realpath(trim($_attr['file'], "'"));
+ if (trim($_attr['type'], "'") == 'file') {
+ $compiler->template->template_resource = realpath(trim($_attr['file'], "'"));
+ } else {
+ $compiler->template->template_resource = trim($_attr['resource'], "'");
+ }
// source object
unset ($compiler->template->source);
$exists = $compiler->template->source->exists;