21

Spent the entire day looking into a bug. The problem was a space in the email address, that was stored in the DB. FML

Comments
  • 3
    Love those :/

    Especially when its a ZWSP char :(
  • 0
    But spaces are allowed in the local part by RFC.
  • 2
    @d4ng3r0u5 Sure, but the problem was, when it was being compared to the user input, which contained valid email address, without the space, it wasn't matching.
  • 1
    How did it happen?
    Don't you check if an email address is valid and do a trim before inserting it in the DB?
  • 3
    @JS96 We do now. :P

    Actually this is some legacy shit, that was dumped on us just recently. There is a lot of other bullshit like this in there too.
  • 0
    #HATEWHITE SPACE lost days on that omg
  • 0
    UTF-8 apostrophes are good for this sort of thing too.
  • 0
    Keyboard error, replace user.
  • 1
    oh, that's nasty...
    We had a similar problem once, but it was with email addresses that were saved, in an external DB we do not manage, with upper and lower cases and sometimes leading/trailing spaces.
    Since then we always do "trim" and "lowercase"...
  • 1
    @JS96 also, valid for emails is not that easy once you go beyond the American alphabet.

    Very few validatiors actually do a good job, and then you have some chars that depending on db collation might collide despite being separate ;). Like the german double s that are still used in some words but where the word can be written using either two s or the double s.
    Problem is, sql server considers them the same for a unique constraint, but they are actually two different spellings.

    And thats not the only one :/
Add Comment