fixed propagation of $this into evald code in smarty_function_eval()

This commit is contained in:
messju
2003-06-22 23:05:36 +00:00
parent 71eda49023
commit e17793eb4d

View File

@@ -32,6 +32,7 @@ function smarty_function_eval($params, &$smarty)
$smarty->_compile_source('evaluated template', $params['var'], $_var_compiled); $smarty->_compile_source('evaluated template', $params['var'], $_var_compiled);
ob_start(); ob_start();
$this =& $smarty; /* this should be done nicer, maybe */
eval('?>' . $_var_compiled); eval('?>' . $_var_compiled);
$_contents = ob_get_contents(); $_contents = ob_get_contents();
ob_end_clean(); ob_end_clean();