Skip to content

Commit

Permalink
Merge pull request #5358 from nextcloud/fix/sharing/long-addresses
Browse files Browse the repository at this point in the history
fix(sharing): skip long email addresses
  • Loading branch information
st3iny authored Jul 17, 2023
2 parents 7550785 + 7899440 commit afb60be
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/Controller/EmailController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/**
* @author Thomas Citharel
* @author Georg Ehrke
* @author Richard Steinmetz
*
* @copyright 2016 Thomas Citharel <tcit@tcit.fr>
* @copyright 2019 Georg Ehrke <oc.list@georgehrke.com>
Expand Down Expand Up @@ -104,6 +105,12 @@ public function __construct(string $appName,
public function sendEmailPublicLink(string $recipient,
string $token,
string $calendarName):JSONResponse {
if (strlen($recipient) > 512) {
return new JSONResponse([
'message' => $this->l10n->t('Provided email-address is too long'),
], Http::STATUS_BAD_REQUEST);
}

$user = $this->userSession->getUser();
if (!$user) {
return new JSONResponse([
Expand Down

0 comments on commit afb60be

Please sign in to comment.