From 49df67b539562ab15551f8d3733ecee8aac9573d Mon Sep 17 00:00:00 2001 From: mohrt Date: Mon, 24 Feb 2003 16:10:35 +0000 Subject: [PATCH] fix _assign_smarty_interface to not overwrite keys other than 'request' --- NEWS | 2 ++ libs/Smarty.class.php | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index 1346c641..62b2693d 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ + - fix _assign_smarty_interface to not overwrite keys + other than 'request' (Jerome Poudevigne, Monte) - added html_radios to distribution (Christopher Kvarme, Monte) - fixed string_format modifier args (wrong order) (Paul Lockaby, Monte) diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 59cc24b6..a6e98f02 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -1198,8 +1198,9 @@ class Smarty */ function _assign_smarty_interface() { - if ($this->_smarty_vars !== null) + if (isset($this->_smarty_vars) && isset($this->_smarty_vars['request'])) { return; + } $globals_map = array('g' => 'HTTP_GET_VARS', 'p' => 'HTTP_POST_VARS', @@ -1207,16 +1208,17 @@ class Smarty 's' => 'HTTP_SERVER_VARS', 'e' => 'HTTP_ENV_VARS'); - $smarty = array('request' => array()); + $_smarty_vars_request = array(); foreach (preg_split('!!', strtolower($this->request_vars_order)) as $c) { if (isset($globals_map[$c])) { - $smarty['request'] = array_merge($smarty['request'], $GLOBALS[$globals_map[$c]]); + $_smarty_vars_request = array_merge($_smarty_vars_request, $GLOBALS[$globals_map[$c]]); } } - $smarty['request'] = @array_merge($smarty['request'], $GLOBALS['HTTP_SESSION_VARS']); + $_smarty_vars_request = @array_merge($_smarty_vars_request, $GLOBALS['HTTP_SESSION_VARS']); - $this->_smarty_vars = $smarty; + $this->_smarty_vars['request'] = $_smarty_vars_request; + }