From 40b92ae6feca20289baf8ac57db5a85e08a73c53 Mon Sep 17 00:00:00 2001 From: Pierre Ozoux Date: Fri, 8 Dec 2017 15:39:06 +0100 Subject: [PATCH] Properly merge master --- lib/imap.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/imap.php b/lib/imap.php index 3608ecd..e53fb46 100644 --- a/lib/imap.php +++ b/lib/imap.php @@ -46,6 +46,12 @@ class OC_User_IMAP extends \OCA\user_external\Base { return false; } + // Replace escaped @ symbol in uid (which is a mail address) + // but only if there is no @ symbol and if there is a %40 inside the uid + if (!(strpos($uid, '@') !== false) && (strpos($uid, '%40') !== false)) { + $uid = str_replace("%40","@",$uid); + } + $result = OC_DB::executeAudited( 'SELECT `userid` FROM `*PREFIX*preferences`' . ' WHERE `appid` = "settings" AND `configkey` = "email" AND `configvalue` = ?', @@ -56,12 +62,6 @@ class OC_User_IMAP extends \OCA\user_external\Base { $users[] = $row['userid']; } - // Replace escaped @ symbol in uid (which is a mail address) - // but only if there is no @ symbol and if there is a %40 inside the uid - if (!(strpos($uid, '@') !== false) && (strpos($uid, '%40') !== false)) { - $uid = str_replace("%40","@",$uid); - } - if(count($users) === 1) { $username = $uid; $uid = $users[0];