summaryrefslogtreecommitdiffstats
path: root/lib/private/Share20
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2017-09-11 00:56:20 +0200
committerMorris Jobke <hey@morrisjobke.de>2017-11-27 09:38:39 +0100
commit1c25919cf18d3b4b690d22aa749735997227eca4 (patch)
tree834659606aeca89639cb2f1219dfb96caea834b0 /lib/private/Share20
parent56a25125817f4f0172c2310dca719bdcb5cbef8e (diff)
downloadnextcloud-server-1c25919cf18d3b4b690d22aa749735997227eca4.tar.gz
nextcloud-server-1c25919cf18d3b4b690d22aa749735997227eca4.zip
Proper handle null cases and default to true
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'lib/private/Share20')
-rw-r--r--lib/private/Share20/DefaultShareProvider.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php
index ca0a6349db4..844b36b2994 100644
--- a/lib/private/Share20/DefaultShareProvider.php
+++ b/lib/private/Share20/DefaultShareProvider.php
@@ -183,6 +183,9 @@ class DefaultShareProvider implements IShareProvider {
throw new ShareNotFound();
}
+ $mailSendValue = $share->getMailSend();
+ $data['mail_send'] = ($mailSendValue === null) ? true : $mailSendValue;
+
$share = $this->createShare($data);
return $share;
}
@@ -837,7 +840,7 @@ class DefaultShareProvider implements IShareProvider {
->setShareType((int)$data['share_type'])
->setPermissions((int)$data['permissions'])
->setTarget($data['file_target'])
- ->setMailSend(true);
+ ->setMailSend((bool)$data['mail_send']);
$shareTime = new \DateTime();
$shareTime->setTimestamp((int)$data['stime']);