diff options
author | Kate <26026535+provokateurin@users.noreply.github.com> | 2024-10-25 08:26:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-25 08:26:36 +0200 |
commit | e46f180d267d00ac17f20dd03c6492df33b7522b (patch) | |
tree | 03f8537d31ebe94f1402f5d551632a5648efd4f5 /apps | |
parent | 935a545addf564517d9335638eeaf1dd46d9d3ae (diff) | |
parent | 0f2013d24fd709bc9324d833259bf49cb0707c3e (diff) | |
download | nextcloud-server-e46f180d267d00ac17f20dd03c6492df33b7522b.tar.gz nextcloud-server-e46f180d267d00ac17f20dd03c6492df33b7522b.zip |
Merge pull request #48881 from nextcloud/backport/48381/stable30
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareAPIController.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index 1be1fdbbde9..0d825deea9e 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -658,7 +658,16 @@ class ShareAPIController extends OCSController { $this->checkInheritedAttributes($share); // Handle mail send - if ($sendMail === 'true' || $sendMail === 'false') { + if (is_null($sendMail)) { + // Define a default behavior when sendMail is not provided + if ($shareType === IShare::TYPE_EMAIL && strlen($shareWith) !== 0) { + // For email shares, the default is to send the mail + $share->setMailSend(true); + } else { + // For all other share types, the default is to not send the mail + $share->setMailSend(false); + } + } else { $share->setMailSend($sendMail === 'true'); } |