aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Collaboration/Collaborators/MailPlugin.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Collaboration/Collaborators/MailPlugin.php')
-rw-r--r--lib/private/Collaboration/Collaborators/MailPlugin.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/private/Collaboration/Collaborators/MailPlugin.php b/lib/private/Collaboration/Collaborators/MailPlugin.php
index 134970518bc..55e3945ace2 100644
--- a/lib/private/Collaboration/Collaborators/MailPlugin.php
+++ b/lib/private/Collaboration/Collaborators/MailPlugin.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@@ -100,6 +101,11 @@ class MailPlugin implements ISearchPlugin {
$emailAddress = $emailAddressData['value'];
$emailAddressType = $emailAddressData['type'];
}
+
+ if (!filter_var($emailAddress, FILTER_VALIDATE_EMAIL)) {
+ continue;
+ }
+
if (isset($contact['FN'])) {
$displayName = $contact['FN'] . ' (' . $emailAddress . ')';
}
@@ -223,8 +229,8 @@ class MailPlugin implements ISearchPlugin {
$reachedEnd = true;
if ($this->shareeEnumeration) {
- $reachedEnd = (count($result['wide']) < $offset + $limit) &&
- (count($userResults['wide']) < $offset + $limit);
+ $reachedEnd = (count($result['wide']) < $offset + $limit)
+ && (count($userResults['wide']) < $offset + $limit);
$result['wide'] = array_slice($result['wide'], $offset, $limit);
$userResults['wide'] = array_slice($userResults['wide'], $offset, $limit);