diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-12-01 17:43:05 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-12-01 17:43:05 +0100 |
commit | 3061e5d2fcc0001d05c66dc9d4a2c1b17e51d31f (patch) | |
tree | 436a9b36b2a87a0370d161a1d2c3fe800447b3b9 /lib/private/share/share.php | |
parent | 8931ba4a0d574a05cf4415f2556bdd3ee0388ba9 (diff) | |
download | nextcloud-server-3061e5d2fcc0001d05c66dc9d4a2c1b17e51d31f.tar.gz nextcloud-server-3061e5d2fcc0001d05c66dc9d4a2c1b17e51d31f.zip |
Check the expiration date for null
* null is always less than any value -> expirationDate gets null
which is "no date set"
* ref https://github.com/owncloud/core/issues/20590#issuecomment-158393075
Diffstat (limited to 'lib/private/share/share.php')
-rw-r--r-- | lib/private/share/share.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/share/share.php b/lib/private/share/share.php index 1308c99f804..e59cd3bc8c5 100644 --- a/lib/private/share/share.php +++ b/lib/private/share/share.php @@ -2243,7 +2243,13 @@ class Share extends Constants { } else { // TODO Don't check if inside folder $result['parent'] = $checkReshare['id']; - $result['expirationDate'] = min($expirationDate, $checkReshare['expiration']); + + $result['expirationDate'] = $expirationDate; + // $checkReshare['expiration'] could be null and then is always less than any value + if(isset($checkReshare['expiration']) && $checkReshare['expiration'] < $expirationDate) { + $result['expirationDate'] = $checkReshare['expiration']; + } + // only suggest the same name as new target if it is a reshare of the // same file/folder and not the reshare of a child if ($checkReshare[$column] === $itemSource) { |