]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix default internal expiration date
authorDaniel Calviño Sánchez <danxuliu@gmail.com>
Thu, 12 Nov 2020 10:49:40 +0000 (11:49 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Mon, 16 Nov 2020 13:16:57 +0000 (13:16 +0000)
The default expiration date for internal shares was set from the default
link expiration date instead of the internal one.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
lib/private/Share20/Manager.php

index 1b1818a6e48d377410513ac38c009c2aab85b9c9..fad18dd28591a30e52eb6f068bf70ba585b9371f 100644 (file)
@@ -409,9 +409,9 @@ class Manager implements IManager {
                        $expirationDate = new \DateTime();
                        $expirationDate->setTime(0,0,0);
 
-                       $days = (int)$this->config->getAppValue('core', 'internal_defaultExpDays', $this->shareApiLinkDefaultExpireDays());
-                       if ($days > $this->shareApiLinkDefaultExpireDays()) {
-                               $days = $this->shareApiLinkDefaultExpireDays();
+                       $days = (int)$this->config->getAppValue('core', 'internal_defaultExpDays', (string)$this->shareApiInternalDefaultExpireDays());
+                       if ($days > $this->shareApiInternalDefaultExpireDays()) {
+                               $days = $this->shareApiInternalDefaultExpireDays();
                        }
                        $expirationDate->add(new \DateInterval('P'.$days.'D'));
                }