From 6869fa9a49e591a561481f9efe0b598c06584c60 Mon Sep 17 00:00:00 2001 From: "Uwe.Tews" Date: Wed, 7 Oct 2009 15:52:57 +0000 Subject: [PATCH] - bugfix on {insert} --- libs/sysplugins/internal.compile_include.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libs/sysplugins/internal.compile_include.php b/libs/sysplugins/internal.compile_include.php index 14e7a47f..eceedc7d 100644 --- a/libs/sysplugins/internal.compile_include.php +++ b/libs/sysplugins/internal.compile_include.php @@ -33,14 +33,15 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase { if (true) { // check if compiled code can be merged if (strpos($include_file, '$_smarty_tpl') === false) { - $tpl = $compiler->smarty->createTemplate (trim($include_file, "'\""), $compiler->template->cache_id, $compiler->template->compile_id, $compiler->template); + eval("\$tmp = $include_file;"); + $tpl = $compiler->smarty->createTemplate ($tmp, $compiler->template->cache_id, $compiler->template->compile_id, $compiler->template); do { $must_compile = false; $prop = array(); $compiled_tpl = $tpl->getCompiledTemplate(); - preg_match('/(\<\?php \$_smarty_tpl-\>decodeProperties\(\')(.*)(\'.*\?\>)/', $compiled_tpl, $matches); - $compiled_tpl = preg_replace(array('/(\<\?php \$_smarty_tpl-\>decodeProperties\(\')(.*)(\'.*\?\>.*\n)/','/(\<\?php if\(\!defined\(\'SMARTY_DIR\'\)\))(.*)(\?\>.*\n)/'), '', $compiled_tpl); - //var_dump($matches, $compiled_tpl); + preg_match('/(\<\?php \$_smarty_tpl-\>decodeProperties\(\')(.*)(\'.*\?\>)/', $compiled_tpl, $matches); + $compiled_tpl = preg_replace(array('/(\<\?php \$_smarty_tpl-\>decodeProperties\(\')(.*)(\'.*\?\>.*\n)/', '/(\<\?php if\(\!defined\(\'SMARTY_DIR\'\)\))(.*)(\?\>.*\n)/'), '', $compiled_tpl); + // var_dump($matches, $compiled_tpl); if (isset($matches[2])) { $prop = unserialize($matches[2]); foreach ($prop['file_dependency'] as $_file_to_check) {