From 1f7a82e2be95aaebd8ba0f6b98bcd9149b7e1719 Mon Sep 17 00:00:00 2001 From: Di Wu Date: Tue, 15 Dec 2015 17:37:53 +0800 Subject: [PATCH] Compatible with PHP7 Explicitly defining the evaluation order with the curly braces. In PHP5 `` $person->$property['first'] is evaluated as $person->{$property['first']} `` But in PHP7 `` $person->$property['first'] is evaluated as {$person->$property}['first'] `` --- libs/sysplugins/smarty_internal_templatecompilerbase.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/sysplugins/smarty_internal_templatecompilerbase.php b/libs/sysplugins/smarty_internal_templatecompilerbase.php index 04584a40..c2100316 100644 --- a/libs/sysplugins/smarty_internal_templatecompilerbase.php +++ b/libs/sysplugins/smarty_internal_templatecompilerbase.php @@ -657,7 +657,7 @@ abstract class Smarty_Internal_TemplateCompilerBase if (!is_array($function)) { return $function($new_args, $this); } elseif (is_object($function[0])) { - return $this->default_handler_plugins[$plugin_type][$tag][0][0]->$function[1]($new_args, + return $this->default_handler_plugins[$plugin_type][$tag][0][0]->{$function[1]}($new_args, $this); } else { return call_user_func_array($function, array($new_args, $this)); @@ -716,7 +716,7 @@ abstract class Smarty_Internal_TemplateCompilerBase if (!is_array($function)) { return $function($args, $this); } elseif (is_object($function[0])) { - return $this->smarty->registered_plugins[Smarty::PLUGIN_COMPILER][$tag][0][0]->$function[1]($args, + return $this->smarty->registered_plugins[Smarty::PLUGIN_COMPILER][$tag][0][0]->{$function[1]}($args, $this); } else { return call_user_func_array($function, array($args, $this));