diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-01-11 15:44:25 +0100 |
---|---|---|
committer | Carl Schwan <carl@carlschwan.eu> | 2022-01-11 15:44:25 +0100 |
commit | d4a5e480ab9fb2337909f1be3c30048a8eb14d78 (patch) | |
tree | aa3437404503e6ab2161d05cb0ef0f362709ec7c | |
parent | 796764aafd318cfeedf6d19af4551e846a40ac94 (diff) | |
download | nextcloud-server-d4a5e480ab9fb2337909f1be3c30048a8eb14d78.tar.gz nextcloud-server-d4a5e480ab9fb2337909f1be3c30048a8eb14d78.zip |
Fix idn emails not working in shares
Fix #30595
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
-rw-r--r-- | lib/private/Collaboration/Collaborators/MailPlugin.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/private/Collaboration/Collaborators/MailPlugin.php b/lib/private/Collaboration/Collaborators/MailPlugin.php index 9e35aa828da..53a223b38dd 100644 --- a/lib/private/Collaboration/Collaborators/MailPlugin.php +++ b/lib/private/Collaboration/Collaborators/MailPlugin.php @@ -247,11 +247,14 @@ class MailPlugin implements ISearchPlugin { $userResults['wide'] = array_slice($userResults['wide'], $offset, $limit); } + [$username, $domain] = explode('@', $search); + $domain = idn_to_ascii($domain); + $searchIdn = $username . '@' . $domain; - if (!$searchResult->hasExactIdMatch($emailType) && filter_var($search, FILTER_VALIDATE_EMAIL)) { + if (!$searchResult->hasExactIdMatch($emailType) && filter_var($searchIdn, FILTER_VALIDATE_EMAIL)) { $result['exact'][] = [ 'label' => $search, - 'uuid' => $search, + 'uuid' => $searchIdn, 'value' => [ 'shareType' => IShare::TYPE_EMAIL, 'shareWith' => $search, |