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
This commit is contained in:
Morris Jobke 2015-12-01 17:43:05 +01:00
parent 8931ba4a0d
commit 3061e5d2fc
1 changed files with 7 additions and 1 deletions

View File

@ -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) {