[Pkg-owncloud-commits] [owncloud] 41/86: Check the expiration date for null

David Prévot taffit at moszumanska.debian.org
Tue Dec 22 16:51:58 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v8.1.5
in repository owncloud.

commit e2b7f66b26313bd45e059d3640619d0dd45b1140
Author: Morris Jobke <hey at morrisjobke.de>
Date:   Tue Dec 1 17:43:05 2015 +0100

    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
---
 lib/private/share/share.php | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index 4dd92ac..c569a95 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) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list