summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2016-02-08 10:42:15 +0100
committerRoeland Jago Douma <rullzer@owncloud.com>2016-02-09 11:05:14 +0100
commitee65cd0bd80d3c46d1210e9a4e8b55b0252de450 (patch)
treec73462c80423d24100c16eef2fe4e240b6729fe6 /lib/private
parent7e0ddfe0d0dc2f947d1ed45d8fdc44f7badba6bb (diff)
downloadnextcloud-server-ee65cd0bd80d3c46d1210e9a4e8b55b0252de450.tar.gz
nextcloud-server-ee65cd0bd80d3c46d1210e9a4e8b55b0252de450.zip
Only set the default expiration date on share creation
Fixes #19685 The default expiration date should only be set when we create a new share. So if a share is created and the expiration date is unset. And after that the password is updated the expiration date should remain unset.
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/share20/manager.php2
-rw-r--r--lib/private/share20/share.php3
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/share20/manager.php b/lib/private/share20/manager.php
index 7cd44a7cb37..c00d7aa4072 100644
--- a/lib/private/share20/manager.php
+++ b/lib/private/share20/manager.php
@@ -261,7 +261,7 @@ class Manager implements IManager {
}
// If expiredate is empty set a default one if there is a default
- if ($expirationDate === null && $this->shareApiLinkDefaultExpireDate()) {
+ if ($share->getFullId() === null && $expirationDate === null && $this->shareApiLinkDefaultExpireDate()) {
$expirationDate = new \DateTime();
$expirationDate->setTime(0,0,0);
$expirationDate->add(new \DateInterval('P'.$this->shareApiLinkDefaultExpireDays().'D'));
diff --git a/lib/private/share20/share.php b/lib/private/share20/share.php
index cd30f24c42e..eb112d37942 100644
--- a/lib/private/share20/share.php
+++ b/lib/private/share20/share.php
@@ -90,6 +90,9 @@ class Share implements \OCP\Share\IShare {
* @inheritdoc
*/
public function getFullId() {
+ if ($this->providerId === null || $this->id === null) {
+ return null;
+ }
return $this->providerId . ':' . $this->id;
}