diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2015-08-29 13:31:18 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2015-08-30 10:31:43 +0200 |
commit | 2aff11c80bbc7fb0524c52d17824d68bda43aac5 (patch) | |
tree | c0c82538bdbdf9fc38f983831c091ba707ba2e58 /lib/private | |
parent | fc64ea670d63b125d277ddcacc0b48253b62c28d (diff) | |
download | nextcloud-server-2aff11c80bbc7fb0524c52d17824d68bda43aac5.tar.gz nextcloud-server-2aff11c80bbc7fb0524c52d17824d68bda43aac5.zip |
Actually validate the expire date on share
* Added more intergration tests
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/share/share.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/private/share/share.php b/lib/private/share/share.php index 9aea4677b5b..7b052483ac3 100644 --- a/lib/private/share/share.php +++ b/lib/private/share/share.php @@ -649,6 +649,21 @@ class Share extends Constants { $permissions = (int)$permissions & ~\OCP\Constants::PERMISSION_DELETE; } + //Validate expirationDate + if ($expirationDate !== null) { + try { + /* + * Reuse the validateExpireDate. + * We have to pass time() since the second arg is the time + * the file was shared, since it is not shared yet we just use + * the current time. + */ + $expirationDate = self::validateExpireDate($expirationDate->format('Y-m-d'), time(), $itemType, $itemSource); + } catch (\Exception $e) { + throw new \OC\HintException($e->getMessage(), $e->getMessage(), 404); + } + } + // Verify share type and sharing conditions are met if ($shareType === self::SHARE_TYPE_USER) { if ($shareWith == $uidOwner) { |