Opened 11 years ago

Closed 11 years ago

#5952 closed (fixed)

escape filter doesn't work inside blocktrans

Reported by: Cedric Rossi <cedric@…> Owned by: nobody
Component: Template system Version: master
Severity: Keywords:
Cc: cedric@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


(tested in [6675])

Within templates, with the new auto-escaping mechanism:

{% blocktrans with title|escape as the_title %}{{ the_title }}{% endblocktrans %} 

will *not* escape the variable title

Replacing that by

{% blocktrans with title|force_escape as the_title %}{{ the_title }}{% endblocktrans %}

works properly though.

Please see the attached self-containing project.

Attachments (1) (6.1 KB) - added by Cedric Rossi <cedric@…> 11 years ago.

Download all attachments as: .zip

Change History (3)

Changed 11 years ago by Cedric Rossi <cedric@…>

Attachment: added

comment:1 Changed 11 years ago by Cedric Rossi <cedric@…>

Cc: cedric@… added

comment:2 Changed 11 years ago by Malcolm Tredinnick

Resolution: fixed
Status: newclosed

(In [6682]) Fixed a few problems with variable resolving inside of blocktrans tags. A couple of these were exposed by the auto-escaping changes, but I suspect the other one has been hiding in plain sight for a while.

Fixed #5952, #5953

Note: See TracTickets for help on using tickets.
Back to Top