mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-14 11:27:00 +00:00
fixed escaping for filtered object attributes (closes #59)
This commit is contained in:
@@ -71,7 +71,7 @@ class Twig_NodeVisitor_Escaper implements Twig_NodeVisitorInterface
|
||||
|
||||
if ($expression instanceof Twig_Node_Expression_Filter) {
|
||||
// don't escape if the primary node of the filter is not a variable
|
||||
if (!$expression->node instanceof Twig_Node_Expression_Name) {
|
||||
if (!$expression->node instanceof Twig_Node_Expression_GetAttr && !$expression->node instanceof Twig_Node_Expression_Name) {
|
||||
return $node;
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -3,6 +3,7 @@
|
||||
--TEMPLATE--
|
||||
{% autoescape on %}
|
||||
{{ user.name }}
|
||||
{{ user.name|lower }}
|
||||
{% endautoescape %}
|
||||
--DATA--
|
||||
class UserForAutoEscapeTest
|
||||
@@ -15,3 +16,4 @@ class UserForAutoEscapeTest
|
||||
return array('user' => new UserForAutoEscapeTest())
|
||||
--EXPECT--
|
||||
Fabien<br />
|
||||
fabien<br />
|
||||
|
||||
Reference in New Issue
Block a user