Opened 3 hours ago

#36658 new Bug

Invalid numeric literal in an {% if %} tag is treated as a variable

Reported by: Lily Owned by:
Component: Template system Version: 5.2
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

I would expect the following template to raise a TemplateSyntaxError during parsing:

{% if 1.1.1 %}foo{% endif %}

Instead, the 1.1.1 is treated as a variable name, so this will render an empty string (or "foo" if the context looks like {"1": {"1": {"1": "bar"}}} or similar).

Change History (0)

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