mirror of
https://github.com/django/django.git
synced 2025-12-15 21:45:20 +00:00
Fixed #8966 -- Changed is_safe for length_is filter to False, since its return value is a boolean, not a string.
Thanks Thomas Steinacher and carljm. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9291 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
34acd39e5d
commit
2026934600
3 changed files with 11 additions and 1 deletions
|
|
@ -241,6 +241,12 @@ Template filter code falls into one of two situations:
|
|||
this tricky, but keep an eye out for any problems like that when
|
||||
reviewing your code.
|
||||
|
||||
Marking a filter ``is_safe`` will coerce the filter's return value to
|
||||
a string. If your filter should return a boolean or other non-string
|
||||
value, marking it ``is_safe`` will probably have unintended
|
||||
consequences (such as converting a boolean False to the string
|
||||
'False').
|
||||
|
||||
2. Alternatively, your filter code can manually take care of any necessary
|
||||
escaping. This is necessary when you're introducing new HTML markup into
|
||||
the result. You want to mark the output as safe from further
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue