mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-03 18:04:26 +02:00
Merge pull request #540 from Hunman/master
Fixing problem with assigning value to object variables as arrays in smarty_internal_compile_assign
This commit is contained in:
@@ -83,7 +83,7 @@ class Smarty_Internal_Compile_Assign extends Smarty_Internal_CompileBase
|
||||
if (isset($parameter[ 'smarty_internal_index' ])) {
|
||||
$output =
|
||||
"<?php \$_tmp_array = isset(\$_smarty_tpl->tpl_vars[{$_var}]) ? \$_smarty_tpl->tpl_vars[{$_var}]->value : array();\n";
|
||||
$output .= "if (!is_array(\$_tmp_array) || \$_tmp_array instanceof ArrayAccess) {\n";
|
||||
$output .= "if (!(is_array(\$_tmp_array) || \$_tmp_array instanceof ArrayAccess)) {\n";
|
||||
$output .= "settype(\$_tmp_array, 'array');\n";
|
||||
$output .= "}\n";
|
||||
$output .= "\$_tmp_array{$parameter['smarty_internal_index']} = {$_attr['value']};\n";
|
||||
|
Reference in New Issue
Block a user