Ticket #9111: safestring-r9066.diff

File safestring-r9066.diff, 1.1 KB (added by Ivan Giuliani, 16 years ago)
  • django/forms/forms.py

     
    55from copy import deepcopy
    66
    77from django.utils.datastructures import SortedDict
    8 from django.utils.html import escape
     8from django.utils.html import escape, conditional_escape
    99from django.utils.encoding import StrAndUnicode, smart_unicode, force_unicode
    1010from django.utils.safestring import mark_safe
    1111
     
    140140        output, hidden_fields = [], []
    141141        for name, field in self.fields.items():
    142142            bf = BoundField(self, field, name)
    143             bf_errors = self.error_class([escape(error) for error in bf.errors]) # Escape and cache in local variable.
     143            bf_errors = self.error_class([conditional_escape(error) for error in bf.errors]) # Escape and cache in local variable.
    144144            if bf.is_hidden:
    145145                if bf_errors:
    146146                    top_errors.extend([u'(Hidden field %s) %s' % (name, force_unicode(e)) for e in bf_errors])
Back to Top