mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-16 04:16:28 +00:00
reverted partially a previous commit
This code was not only useful for macros but also when you call a method on a template instance -- this is not recommended/supported but used by the Symfony profiler)
This commit is contained in:
@@ -422,7 +422,15 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
||||
$this->env->getExtension('sandbox')->checkMethodAllowed($object, $method);
|
||||
}
|
||||
|
||||
return call_user_func_array(array($object, $method), $arguments);
|
||||
$ret = call_user_func_array(array($object, $method), $arguments);
|
||||
|
||||
// useful when calling a template method from a template
|
||||
// this is not supported but unfortunately heavily used in the Symfony profiler
|
||||
if ($object instanceof Twig_TemplateInterface) {
|
||||
return $ret === '' ? '' : new Twig_Markup($ret, $this->env->getCharset());
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user