This is an issue that was fixed after PR4. This is related to an
operator precedence problem for the ternary operator. The problem is
only visible when the output escaping is involved, that's why it was not
detected by the unit tests.
It should disappear if you upgrade Twig to the current master. Or you
can find the patch here:
https://github.com/fabpot/Twig/commit/031bf84b254fb9e8c04b4770f1d4fec077390e99
Fabien
--
Fabien Potencier
Sensio CEO - symfony lead developer
sensiolabs.com | symfony-project.org | fabien.potencier.org
Tél: +33 1 40 99 80 80
On 12/9/10 1:36 AM, Dennis Jacobfeuerborn wrote:
After updating my app to PR4 I'm seeing a strange case of quotes
magically appearing in my templates. Consider the following line from
the twig template:
<a href="{% path 'list_racks' %}" {{ nav_area == 'rack' ?
'class=active' : '' }}>Racks</a>
now if nav_area is set to "rack" this gets rendered as:
.... class="active" ....
Where do the quotes come from?
To make things more weird changing the template to this:
<a href="{% path 'list_racks' %}" {{ nav_area == 'rack' ?
'class="active"' : '' }}>Racks</a>
(i.e. adding the quotes manually) results in this:
.... class=""active"" ....
It seems twig no longer treats this as a literal string. Is this
intended? What if I actually wanted to have 'class=active' rendered
without the quotes?
Regards,
Dennis
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en