aboutsummaryrefslogtreecommitdiffstats
path: root/apps/sharebymail/lib/ShareByMailProvider.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/sharebymail/lib/ShareByMailProvider.php')
-rw-r--r--apps/sharebymail/lib/ShareByMailProvider.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php
index 62ba9d35f3f..65a7498bcd6 100644
--- a/apps/sharebymail/lib/ShareByMailProvider.php
+++ b/apps/sharebymail/lib/ShareByMailProvider.php
@@ -334,6 +334,16 @@ class ShareByMailProvider implements IShareProvider {
$share->getNote()
);
+ if ($this->mailer->validateMailAddress($share->getSharedWith())) {
+ $this->removeShareFromTable($shareId);
+ $e = new HintException('Failed to send share by mail. Got an invalid email address: ' . $share->getSharedWith(),
+ $this->l->t('Failed to send share by email. Got an invalid email address'));
+ $this->logger->error($e->getMessage(), [
+ 'message' => 'Failed to send share by mail. Got an invalid email address ' . $share->getSharedWith(),
+ 'app' => 'sharebymail',
+ ]);
+ }
+
try {
$link = $this->urlGenerator->linkToRouteAbsolute('files_sharing.sharecontroller.showShare',
['token' => $share->getToken()]);