Opened 15 years ago

Last modified 12 years ago

#11679 closed

FormWizard: security_hash() has issues with Safari leaving in \r\n — at Version 1

Reported by: al@… Owned by: nobody
Component: contrib.formtools Version: 1.0
Severity: Normal Keywords: FormWizard
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Karen Tracey)

In v1.0.3: The latest Safari is passing in \r\n within the text fields. These are blowing up the security_hash() call when on Step 2 of a multiple step FormWizard.

Try the test:

f1 = TestForm({'name': 'joe', 'bio': 'Nothing\r\nnotable.'})

Similar to fix r10752; changing django/contrib/formtools/utils.py as follows works around the issue:

25:  if isinstance(value, basestring):
26:    value = value.strip()
27+    value = value.replace('\r', ' ')
28+    value = value.replace('\n', ' ')

Change History (1)

comment:1 by Karen Tracey, 15 years ago

Description: modified (diff)

Fixed description: reference is to a changeset, not a ticket.

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