Opened 13 years ago

Closed 13 years ago

#1198 closed defect (fixed)

backslash-escape doesn't work on date filters

Reported by: inerte@… Owned by: Adrian Holovaty
Component: Template system Version: master
Severity: blocker Keywords: filter, date
Cc: dcf@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


published on {{ object.pub_date|date:"jS o\f F" }}

Shows published on 9th o8:28 January

I was expecting the same behaviour as now, since that's what the documentation says...


It is the {% now "jS o\f F" %}

Shows It is the 10th of January

I am taking the liberty of setting the Severity to "blocker" since I wouldn't want to see this on a production enviroment :)

Change History (3)

comment:1 Changed 13 years ago by dcf

The cause appears to be the fact that the FilterExpression init method
strips out the '\' from constant args, so by the time the format string
gets to the format call, the format string has been modified to "js of F".

Anyone know why this is done?

comment:2 Changed 13 years ago by anonymous

Cc: dcf@… added

comment:3 Changed 13 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

(In [2713]) magic-removal: Fixed #1198 -- Modified handling of escape characters in filter arguments, and updated unit tests to reflect the change.

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