Proper handle null cases and default to true

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
Lukas Reschke 2017-09-11 00:56:20 +02:00 committed by Morris Jobke
parent 56a2512581
commit 1c25919cf1
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
1 changed files with 4 additions and 1 deletions

View File

@ -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']);