diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-12-01 17:43:05 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-12-04 15:03:52 +0100 |
commit | e2b7f66b26313bd45e059d3640619d0dd45b1140 (patch) | |
tree | 5b2ed8df02af1acf677097e949f1daaf5cd4276f /lib | |
parent | 7d8aaa81c0221c86d600c637943ffd48889ce6d9 (diff) | |
download | nextcloud-server-e2b7f66b26313bd45e059d3640619d0dd45b1140.tar.gz nextcloud-server-e2b7f66b26313bd45e059d3640619d0dd45b1140.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')
-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 4dd92ac816e..c569a957df7 100644 --- a/lib/private/share/share.php +++ b/lib/private/share/share.php @@ -2166,7 +2166,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) { |