Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sharing): skip long email addresses #5358

Merged
merged 1 commit into from
Jul 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <[email protected]>
* @copyright 2019 Georg Ehrke <[email protected]>
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'),
tcitworld marked this conversation as resolved.
Show resolved Hide resolved
], Http::STATUS_BAD_REQUEST);
}

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