mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-30 12:06:56 +00:00
fixed a PHP fatal error when calling a macro, imported in the template, in another macro
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
* 1.41.1 (2019-XX-XX)
|
||||
|
||||
* fixed a PHP fatal error when calling a macro imported in the template in another macro
|
||||
* fixed wrong error message on "import" and "from"
|
||||
|
||||
* 1.41.0 (2019-05-14)
|
||||
|
||||
+1
-5
@@ -334,11 +334,7 @@ class Parser implements \Twig_ParserInterface
|
||||
|
||||
public function getImportedSymbol($type, $alias)
|
||||
{
|
||||
foreach ($this->importedSymbols as $functions) {
|
||||
if (isset($functions[$type][$alias])) {
|
||||
return $functions[$type][$alias];
|
||||
}
|
||||
}
|
||||
return isset($this->importedSymbols[0][$type][$alias]) ? $this->importedSymbols[0][$type][$alias] : null;
|
||||
}
|
||||
|
||||
public function isMainScope()
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
"from" tag with syntax error
|
||||
--TEMPLATE--
|
||||
{% from _self import another %}
|
||||
|
||||
{% macro foo() %}
|
||||
{{ another() }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro another() %}
|
||||
{% endmacro %}
|
||||
--DATA--
|
||||
return []
|
||||
--EXCEPTION--
|
||||
Twig\Error\SyntaxError: Unknown "another" function in "index.twig" at line 5.
|
||||
Reference in New Issue
Block a user