diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-01-13 09:24:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-13 09:24:26 +0100 |
commit | b1048864f0f8e4218a512b05c6a3a62ba4f6d565 (patch) | |
tree | 680620cd6d0762ba554261eb9b287cf754c4224b /lib | |
parent | 094fbb9c0db38b40d73dcf776a31f0f639f83085 (diff) | |
parent | fffc19f5c3e2e1789564542f3562a7b56b587c8c (diff) | |
download | nextcloud-server-b1048864f0f8e4218a512b05c6a3a62ba4f6d565.tar.gz nextcloud-server-b1048864f0f8e4218a512b05c6a3a62ba4f6d565.zip |
Merge pull request #30600 from nextcloud/fix/30595/idn-email-share
Fix idn emails not working in shares
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Collaboration/Collaborators/MailPlugin.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/private/Collaboration/Collaborators/MailPlugin.php b/lib/private/Collaboration/Collaborators/MailPlugin.php index 9e35aa828da..aae6f305981 100644 --- a/lib/private/Collaboration/Collaborators/MailPlugin.php +++ b/lib/private/Collaboration/Collaborators/MailPlugin.php @@ -38,6 +38,7 @@ use OCP\IGroupManager; use OCP\IUser; use OCP\IUserSession; use OCP\Share\IShare; +use OCP\Mail\IMailer; class MailPlugin implements ISearchPlugin { /* @var bool */ @@ -64,19 +65,23 @@ class MailPlugin implements ISearchPlugin { private $knownUserService; /** @var IUserSession */ private $userSession; + /** @var IMailer */ + private $mailer; public function __construct(IManager $contactsManager, ICloudIdManager $cloudIdManager, IConfig $config, IGroupManager $groupManager, KnownUserService $knownUserService, - IUserSession $userSession) { + IUserSession $userSession, + IMailer $mailer) { $this->contactsManager = $contactsManager; $this->cloudIdManager = $cloudIdManager; $this->config = $config; $this->groupManager = $groupManager; $this->knownUserService = $knownUserService; $this->userSession = $userSession; + $this->mailer = $mailer; $this->shareeEnumeration = $this->config->getAppValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes') === 'yes'; $this->shareWithGroupOnly = $this->config->getAppValue('core', 'shareapi_only_share_with_group_members', 'no') === 'yes'; @@ -247,8 +252,7 @@ class MailPlugin implements ISearchPlugin { $userResults['wide'] = array_slice($userResults['wide'], $offset, $limit); } - - if (!$searchResult->hasExactIdMatch($emailType) && filter_var($search, FILTER_VALIDATE_EMAIL)) { + if (!$searchResult->hasExactIdMatch($emailType) && $this->mailer->validateMailAddress($search)) { $result['exact'][] = [ 'label' => $search, 'uuid' => $search, |