summaryrefslogtreecommitdiffstats
path: root/apps/sharebymail
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2022-11-14 16:23:50 +0100
committerCôme Chilliet <come.chilliet@nextcloud.com>2022-11-14 16:23:50 +0100
commit9ba9f9a7dcd7654336fa714cbd178f6a2c1710a8 (patch)
treeea38b76ffad8bf87890cb6325db30869179f5914 /apps/sharebymail
parentea377578ad50809c13e792acfa2bc1bd6b94df24 (diff)
downloadnextcloud-server-9ba9f9a7dcd7654336fa714cbd178f6a2c1710a8.tar.gz
nextcloud-server-9ba9f9a7dcd7654336fa714cbd178f6a2c1710a8.zip
Make sure to not pass null to DateTime::createFromFormat
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/sharebymail')
-rw-r--r--apps/sharebymail/lib/ShareByMailProvider.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php
index 01dd3b428d1..af3d14b49bc 100644
--- a/apps/sharebymail/lib/ShareByMailProvider.php
+++ b/apps/sharebymail/lib/ShareByMailProvider.php
@@ -1042,8 +1042,8 @@ class ShareByMailProvider implements IShareProvider {
$share->setShareTime($shareTime);
$share->setSharedWith($data['share_with']);
$share->setPassword($data['password']);
- $passwordExpirationTime = \DateTime::createFromFormat('Y-m-d H:i:s', $data['password_expiration_time']);
- $share->setPasswordExpirationTime($passwordExpirationTime !== false? $passwordExpirationTime : null);
+ $passwordExpirationTime = \DateTime::createFromFormat('Y-m-d H:i:s', $data['password_expiration_time'] ?? '');
+ $share->setPasswordExpirationTime($passwordExpirationTime !== false ? $passwordExpirationTime : null);
$share->setLabel($data['label']);
$share->setSendPasswordByTalk((bool)$data['password_by_talk']);
$share->setHideDownload((bool)$data['hide_download']);
@@ -1140,7 +1140,6 @@ class ShareByMailProvider implements IShareProvider {
* @throws ShareNotFound
*/
protected function getRawShare($id) {
-
// Now fetch the inserted share and create a complete share object
$qb = $this->dbConnection->getQueryBuilder();
$qb->select('*')