Code

Opened 6 years ago

Closed 6 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: UI/UX:

Description

(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)

test.zip (6.1 KB) - added by Cedric Rossi <cedric@…> 6 years ago.

Download all attachments as: .zip

Change History (3)

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

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

  • Cc cedric@… added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 6 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

(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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.