[Pkg-owncloud-commits] [owncloud] 32/107: Check the expiration date for null

David Prévot taffit at moszumanska.debian.org
Thu Dec 17 19:40:34 UTC 2015


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

taffit pushed a commit to branch stable8
in repository owncloud.

commit 9aff749ea5b847fa8aa0c15892436642e1b00483
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 f8e347c..95e5e7e 100644
--- a/lib/private/share/share.php
+++ b/lib/private/share/share.php
@@ -2242,7 +2242,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