mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #6160, #9111 -- Consistently apply conditional_escape to form errors and labels when outputing them as HTML.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9365 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -49,4 +49,11 @@ u''
|
||||
# Can take a non-string.
|
||||
>>> print ValidationError(VeryBadError()).messages
|
||||
<ul class="errorlist"><li>A very bad error.</li></ul>
|
||||
|
||||
# Escapes non-safe input but not input marked safe.
|
||||
>>> example = 'Example of link: <a href="http://www.example.com/">example</a>'
|
||||
>>> print ValidationError(example).messages
|
||||
<ul class="errorlist"><li>Example of link: <a href="http://www.example.com/">example</a></li></ul>
|
||||
>>> print ValidationError(mark_safe(example)).messages
|
||||
<ul class="errorlist"><li>Example of link: <a href="http://www.example.com/">example</a></li></ul>
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user