From: Raphaël Barrois Date: Thu, 10 Jun 2010 13:53:39 +0000 (+0200) Subject: Fix ids_from_emails to ignore case in submitted emails X-Git-Tag: xorg/1.0.0~141 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=c37a2d3492d1abdf940de7a303c35874fa75fc37;p=platal.git Fix ids_from_emails to ignore case in submitted emails Signed-off-by: Raphaël Barrois --- diff --git a/include/emails.inc.php b/include/emails.inc.php index f40dbe4..4fdbacf 100644 --- a/include/emails.inc.php +++ b/include/emails.inc.php @@ -147,12 +147,16 @@ function ids_from_mails(array $emails) // Look up user ids for other addresses in the email redirection list if (count($other_mails)) { + $lowerupper = array(); + foreach ($other_mails as $mail) { + $lowerupper[strtolower($mail)] = $mail; + } $res = XDB::query("SELECT email, uid FROM emails WHERE email IN {?}", $other_mails); foreach ($res->fetchAllRow() as $row) { list ($email, $uid) = $row; - $uids[$email] = $uid; + $uids[$lowerupper[strtolower($email)]] = $uid; } }