Problem/Motivation

I had 2 situations that triggered this.

  1. I was wanting to sanitize the mail field so was running it through strtolower in the hook_uif_pre_create() hook.
  2. Shitty data meant users appeared more than once and the case mix of the mail field differed

Proposed resolution

Making the mail lookup case insensitive fixes this.

Comments

gold’s picture

Status: Active » Needs review
StatusFileSize
new781 bytes

...and the patch.

dwightaspinwall’s picture

Good catch. Seems to depend on the default character set and collation of your server, as I am not able to reproduce it on my server. Per http://dev.mysql.com/doc/refman/5.5/en/case-sensitivity.html :

The default character set and collation are latin1 and latin1_swedish_ci, so nonbinary string comparisons are case insensitive by default.

But definitely a bug, and your patch goes part of the way, but there are two other places in the code where this comparison is done and they all need to be changed. I've done that against 7.x-1.x-dev using db_like() and the LIKE comparison in the same way implemented in the user module. Dev snapshot will be available tomorrow.

dwightaspinwall’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.