From 46a8474a82b50b7b3d9d84275671a86370498513 Mon Sep 17 00:00:00 2001 From: andrey Date: Mon, 30 Apr 2001 16:07:55 +0000 Subject: [PATCH] Fix passing config vars to included files. --- Smarty.class.php | 3 ++- Smarty_Compiler.class.php | 2 -- libs/Smarty.class.php | 3 ++- libs/Smarty_Compiler.class.php | 2 -- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Smarty.class.php b/Smarty.class.php index 99b40b68..dc5aec60 100644 --- a/Smarty.class.php +++ b/Smarty.class.php @@ -698,9 +698,10 @@ class Smarty function _smarty_include($_smarty_include_tpl_file, $_smarty_include_vars, &$_smarty_config_parent) { + $_smarty_config = $_smarty_config_parent; $this->_tpl_vars = array_merge($this->_tpl_vars, $_smarty_include_vars); extract($this->_tpl_vars); - + $this->_process_template($_smarty_include_tpl_file, $compile_path); include($compile_path); } diff --git a/Smarty_Compiler.class.php b/Smarty_Compiler.class.php index 6bada0c1..e8c897af 100644 --- a/Smarty_Compiler.class.php +++ b/Smarty_Compiler.class.php @@ -373,8 +373,6 @@ class Smarty_Compiler extends Smarty { return "_tpl_vars;\n" . - "unset(\$_smarty_defined_vars['_smarty_include_tpl_file']);\n" . - "unset(\$_smarty_defined_vars['_smarty_include_vars']);\n" . "\$this->_smarty_include(".$_smarty_include_tpl_file.", array(".implode(',', (array)$arg_list)."), \$_smarty_config);\n" . "\$this->_tpl_vars = \$_smarty_tpl_vars;\n" . "unset(\$_smarty_tpl_vars); ?>"; diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 99b40b68..dc5aec60 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -698,9 +698,10 @@ class Smarty function _smarty_include($_smarty_include_tpl_file, $_smarty_include_vars, &$_smarty_config_parent) { + $_smarty_config = $_smarty_config_parent; $this->_tpl_vars = array_merge($this->_tpl_vars, $_smarty_include_vars); extract($this->_tpl_vars); - + $this->_process_template($_smarty_include_tpl_file, $compile_path); include($compile_path); } diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index 6bada0c1..e8c897af 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -373,8 +373,6 @@ class Smarty_Compiler extends Smarty { return "_tpl_vars;\n" . - "unset(\$_smarty_defined_vars['_smarty_include_tpl_file']);\n" . - "unset(\$_smarty_defined_vars['_smarty_include_vars']);\n" . "\$this->_smarty_include(".$_smarty_include_tpl_file.", array(".implode(',', (array)$arg_list)."), \$_smarty_config);\n" . "\$this->_tpl_vars = \$_smarty_tpl_vars;\n" . "unset(\$_smarty_tpl_vars); ?>";