add isset($_smarty_tpl) to avoid errors when unit test runs in separate process

This commit is contained in:
Uwe Tews
2015-02-08 19:57:14 +01:00
parent e4e3e176c0
commit 1fc2b9ece2

View File

@@ -37,7 +37,10 @@ class Smarty_Internal_Extension_CodeFrame
if ($_template->smarty->direct_access_security) {
$output .= "if(!defined('SMARTY_DIR')) exit('no direct access allowed');\n";
}
$output .= "\$_valid = \$_smarty_tpl->decodeProperties(" . var_export($_template->properties, true) . ',' . ($cache ? 'true' : 'false') . ");\n/*/%%SmartyHeaderCode%%*/\n";
$output .= "if (isset(\$_smarty_tpl)) {\n";
$output .= "\$_valid = \$_smarty_tpl->decodeProperties(" . var_export($_template->properties, true) . ',' . ($cache ? 'true' : 'false') . ");\n";
$output .= "}\n";
$output .= "/*/%%SmartyHeaderCode%%*/\n";
$output .= "if (\$_valid && !is_callable('{$_template->properties['unifunc']}')) {function {$_template->properties['unifunc']} (\$_smarty_tpl) {\n";
// include code for plugins
if (!$cache) {