summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe.Tews@googlemail.com <Uwe.Tews@googlemail.com>2014-03-08 23:03:08 +0000
committerUwe.Tews@googlemail.com <Uwe.Tews@googlemail.com>2014-03-08 23:03:08 +0000
commitaf13907219106fcef2b4cb78ae5943756c3c8ff9 (patch)
treefbb0b8ea7e3718a7d953b5a7b5976b35987630ea
parentf06013927c187ce1cb7da136320e369863bfb2ef (diff)
downloadsmarty-af13907219106fcef2b4cb78ae5943756c3c8ff9.tar.gz
smarty-af13907219106fcef2b4cb78ae5943756c3c8ff9.tar.bz2
smarty-af13907219106fcef2b4cb78ae5943756c3c8ff9.zip
08.03.2014
- bugfix relative file path {include} within {block} of child templates did throw exception on first call (Issue 177)
-rw-r--r--change_log.txt3
-rw-r--r--libs/sysplugins/smarty_internal_compile_block.php7
2 files changed, 10 insertions, 0 deletions
diff --git a/change_log.txt b/change_log.txt
index 800de6f2..f76ec278 100644
--- a/change_log.txt
+++ b/change_log.txt
@@ -1,4 +1,7 @@
===== trunk =====
+ 08.03.2014
+ - bugfix relative file path {include} within {block} of child templates did throw exception on first call (Issue 177)
+
17.02.2014
- bugfix Smarty failed when executing PHP on HHVM (Hip Hop 2.4) because uniqid('',true) does return string with ',' (forum topic 20343)
diff --git a/libs/sysplugins/smarty_internal_compile_block.php b/libs/sysplugins/smarty_internal_compile_block.php
index ba26ed0a..377288df 100644
--- a/libs/sysplugins/smarty_internal_compile_block.php
+++ b/libs/sysplugins/smarty_internal_compile_block.php
@@ -376,6 +376,13 @@ class Smarty_Internal_Compile_Private_Child_Block extends Smarty_Internal_Compil
// check and get attributes
$_attr = $this->getAttributes($compiler, $args);
+ // update template with original template resource of {block}
+ $compiler->template->template_resource = realpath(trim($_attr['file'], "'"));
+ // source object
+ unset ($compiler->template->source);
+ $exists = $compiler->template->source->exists;
+
+
// must merge includes
if ($_attr['nocache'] == true) {
$compiler->tag_nocache = true;