From c37a2d3492d1abdf940de7a303c35874fa75fc37 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Barrois?= Date: Thu, 10 Jun 2010 15:53:39 +0200 Subject: [PATCH] Fix ids_from_emails to ignore case in submitted emails MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Raphaël Barrois --- include/emails.inc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } } -- 2.1.4