mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 10:24:26 +02:00
fix _assign_smarty_interface to not overwrite keys other than 'request'
This commit is contained in:
2
NEWS
2
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)
|
- added html_radios to distribution (Christopher Kvarme, Monte)
|
||||||
- fixed string_format modifier args (wrong order) (Paul
|
- fixed string_format modifier args (wrong order) (Paul
|
||||||
Lockaby, Monte)
|
Lockaby, Monte)
|
||||||
|
@@ -1198,8 +1198,9 @@ class Smarty
|
|||||||
*/
|
*/
|
||||||
function _assign_smarty_interface()
|
function _assign_smarty_interface()
|
||||||
{
|
{
|
||||||
if ($this->_smarty_vars !== null)
|
if (isset($this->_smarty_vars) && isset($this->_smarty_vars['request'])) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$globals_map = array('g' => 'HTTP_GET_VARS',
|
$globals_map = array('g' => 'HTTP_GET_VARS',
|
||||||
'p' => 'HTTP_POST_VARS',
|
'p' => 'HTTP_POST_VARS',
|
||||||
@@ -1207,16 +1208,17 @@ class Smarty
|
|||||||
's' => 'HTTP_SERVER_VARS',
|
's' => 'HTTP_SERVER_VARS',
|
||||||
'e' => 'HTTP_ENV_VARS');
|
'e' => 'HTTP_ENV_VARS');
|
||||||
|
|
||||||
$smarty = array('request' => array());
|
$_smarty_vars_request = array();
|
||||||
|
|
||||||
foreach (preg_split('!!', strtolower($this->request_vars_order)) as $c) {
|
foreach (preg_split('!!', strtolower($this->request_vars_order)) as $c) {
|
||||||
if (isset($globals_map[$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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user