Merge pull request #20877 from owncloud/fix-empty-expirationDate

Check the expiration date for null
This commit is contained in:
Thomas Müller 2015-12-02 10:12:16 +01:00
commit 0bd0212731
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) {