#7833 Trim emails before saving them to mongo NEEDS SCRIPT

v1.3.0
closed
General
Heith Seewald
2015-08-20
2015-02-12
No

Right now you can claim address like "email@example.com " (note spaces in the end) or even "email@example.com\t" (tab in the end, you can't type this but can copy&paste from some source. That's how I discovered this issue actually).

That's a problem because on the UI you can't see this blank symbols and later, when user types the same email in, say, password recovery form, but without spaces in the end, system will not find it, therefore user will not be able to recover password. Also, association of commits with users and other stuff won't work.

Probably fix is as simple as adding .strip() inside EmailAddress.canonical, since we use it everywhere already, but it's good to test/investigate further.

Don't sure what to do with existing emails like this which are already in mongo.

Related

Tickets: #7823

Discussion

  • Igor Bondarenko - 2015-02-12
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,4 @@
    -Right now you can claim address like "email@example.com   " (note spaces in the end) or even "email@example.com\t" (tab in the end, you can't type this but can copy&paste from some source. That's how I discovered this issue actually).
    +Right now you can claim address like `"email@example.com   "` (note spaces in the end) or even `"email@example.com\t"` (tab in the end, you can't type this but can copy&paste from some source. That's how I discovered this issue actually).
    
     That's a problem because on the UI you can't see this blank symbols and later, when user types the same email in, say, password recovery form, but without spaces in the end, system will not find it, therefore user will not be able to recover password. Also, association of commits with users and other stuff won't work.
    
     
  • Igor Bondarenko - 2015-03-04
    • Owner: Anonymous --> Igor Bondarenko
    • Labels: --> 42cc
    • Status: open --> in-progress
     
  • Dave Brondsema

    Dave Brondsema - 2015-03-09
    • labels: 42cc --> 42cc, sf-2, sf-current
     
  • Igor Bondarenko - 2015-03-16
    • status: in-progress --> review
     
  • Igor Bondarenko - 2015-03-16

    Closed #741. allura:ib/7833

    On SF need to run allura/scripts/trim_emails.py ScriptTask to fix emails that are already there (I've checked production db, and there are some).

     
  • Heith Seewald - 2015-03-19
    • Reviewer: Heith Seewald
     
  • Heith Seewald - 2015-03-19
    • status: review --> closed
     
  • Heith Seewald - 2015-03-19

    Looks good Igor :)

     
  • Dave Brondsema

    Dave Brondsema - 2015-03-19
    • summary: Trim emails before saving them to mongo --> Trim emails before saving them to mongo NEEDS SCRIPT
     
  • Dave Brondsema

    Dave Brondsema - 2015-03-23
    • labels: 42cc, sf-2, sf-current --> 42cc, sf-2
     
  • Igor Bondarenko - 2015-06-18
    • Milestone: unreleased --> asf_release_1.3.0
     

Log in to post a comment.