summaryrefslogtreecommitdiffstats
path: root/lib/private/share/share.php
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2014-05-16 14:57:11 -0400
committerBjörn Schießle <schiessle@owncloud.com>2014-05-16 14:57:11 -0400
commit42b99b6d0fbcaf54b3cf3b3c9be5bc8a9c7a2e12 (patch)
treee5eef49dd4ca7a5bb71ef5f2cae583639f79202b /lib/private/share/share.php
parentb52cb8f5570f4ec0e73aa5b2e1a5dbd178135382 (diff)
parent7a48f24459a6e0f253c4893d5d08056e1f22dd43 (diff)
downloadnextcloud-server-42b99b6d0fbcaf54b3cf3b3c9be5bc8a9c7a2e12.tar.gz
nextcloud-server-42b99b6d0fbcaf54b3cf3b3c9be5bc8a9c7a2e12.zip
Merge pull request #8555 from owncloud/sharing_default_expire_only_public_links
use default expire date only for link shares
Diffstat (limited to 'lib/private/share/share.php')
-rw-r--r--lib/private/share/share.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index 440889ea6dc..e0f8e5a184e 100644
--- a/lib/private/share/share.php
+++ b/lib/private/share/share.php
@@ -887,16 +887,20 @@ class Share extends \OC\Share\Constants {
*/
protected static function expireItem(array $item) {
- // get default expire settings
- $defaultSettings = Helper::getDefaultExpireSetting();
// calculate expire date
if (!empty($item['expiration'])) {
$userDefinedExpire = new \DateTime($item['expiration']);
- $userDefinedExpireTimestamp = $userDefinedExpire->getTimestamp();
+ $expires = $userDefinedExpire->getTimestamp();
} else {
- $userDefinedExpireTimestamp = null;
+ $expires = null;
+ }
+
+ // only use default expire date for link shares
+ if((int)$item['share_type'] === self::SHARE_TYPE_LINK) {
+ // get default expire settings
+ $defaultSettings = Helper::getDefaultExpireSetting();
+ $expires = Helper::calculateExpireDate($defaultSettings, $item['stime'], $expires);
}
- $expires = Helper::calculateExpireDate($defaultSettings, $item['stime'], $userDefinedExpireTimestamp);
if (is_int($expires)) {
$now = time();