Ticket #12196: 12196.diff

File 12196.diff, 1.2 KB (added by Simon Zimmermann, 15 years ago)
  • django/forms/fields.py

     
    419419        return value
    420420
    421421email_re = re.compile(
    422     r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*"  # dot-atom
     422    r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]*)*"  # dot-atom
    423423    r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-011\013\014\016-\177])*"' # quoted-string
    424424    r')@(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+[A-Z]{2,6}\.?$', re.IGNORECASE)  # domain
    425425
  • tests/regressiontests/forms/fields.py

     
    767767>>> f.clean('example@valid-with-hyphens.com')
    768768u'example@valid-with-hyphens.com'
    769769
     770>>> f.clean('example...99@valid.com')
     771u'example...99@valid.com'
     772
    770773# Check for runaway regex security problem. This will take for-freeking-ever
    771774# if the security fix isn't in place.
    772775>>> f.clean('viewx3dtextx26qx3d@yahoo.comx26latlngx3d15854521645943074058')
Back to Top