#486 closed defect (fixed)
[patch] Template system incorrectly persists filter arguments
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Template system | Version: | |
Severity: | major | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I've got some text which has had php's nl2br applied to it at some point in the past.
when I apply the following filters
{{topic.body|removetags:"p a br"|escape|linebreaks}}
I receive the following error
.......... File "/usr/lib/python2.3/site-packages/django/core/template.py", line 298, in read_filters raise TemplateSyntaxError, "Filter '%s' should not have an argument" % filter_name TemplateSyntaxError: Filter 'escape' should not have an argument
it does not appear to have this issue when I remove the linebreaks filter
Attachments (1)
Change History (4)
by , 19 years ago
Attachment: | template-args-fix.patch added |
---|
comment:1 by , 19 years ago
Severity: | normal → major |
---|---|
Summary: | Filter 'escape' should not have an argument (it doesn't) → [patch] Template system incorrectly persists filter arguments |
Great catch. It seems that the template system, in certain cases, keeps the argument from the previous filter around. The attached patch fixes this bug.
Note:
See TracTickets
for help on using tickets.
Fix for argimunt bug in template system