Skip to content

Commit ecaa026

Browse files
committed
Update user share must use correct expiration validation
Updating a user or group share now uses the correct method for the validation of the expiration date. Instead of using the one from links it uses the one for internal shares. To avoid future confusion, the method "validateExpirationDate" has been renamed to "validateExpirationDateLink". Signed-off-by: Vincent Petry <vincent@nextcloud.com>
1 parent 8670ef7 commit ecaa026

2 files changed

Lines changed: 45 additions & 45 deletions

File tree

lib/private/Share20/Manager.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ protected function validateExpirationDateInternal(\OCP\Share\IShare $share) {
458458
* @throws \InvalidArgumentException
459459
* @throws \Exception
460460
*/
461-
protected function validateExpirationDate(\OCP\Share\IShare $share) {
461+
protected function validateExpirationDateLink(\OCP\Share\IShare $share) {
462462
$expirationDate = $share->getExpirationDate();
463463

464464
if ($expirationDate !== null) {
@@ -761,7 +761,7 @@ public function createShare(\OCP\Share\IShare $share) {
761761
);
762762

763763
//Verify the expiration date
764-
$share = $this->validateExpirationDate($share);
764+
$share = $this->validateExpirationDateLink($share);
765765

766766
//Verify the password
767767
$this->verifyPassword($share->getPassword());
@@ -969,15 +969,15 @@ public function updateShare(\OCP\Share\IShare $share) {
969969

970970
if ($share->getExpirationDate() != $originalShare->getExpirationDate()) {
971971
//Verify the expiration date
972-
$this->validateExpirationDate($share);
972+
$this->validateExpirationDateInternal($share);
973973
$expirationDateUpdated = true;
974974
}
975975
} elseif ($share->getShareType() === \OCP\Share::SHARE_TYPE_GROUP) {
976976
$this->groupCreateChecks($share);
977977

978978
if ($share->getExpirationDate() != $originalShare->getExpirationDate()) {
979979
//Verify the expiration date
980-
$this->validateExpirationDate($share);
980+
$this->validateExpirationDateInternal($share);
981981
$expirationDateUpdated = true;
982982
}
983983
} elseif ($share->getShareType() === \OCP\Share::SHARE_TYPE_LINK) {
@@ -993,7 +993,7 @@ public function updateShare(\OCP\Share\IShare $share) {
993993

994994
if ($share->getExpirationDate() != $originalShare->getExpirationDate()) {
995995
//Verify the expiration date
996-
$this->validateExpirationDate($share);
996+
$this->validateExpirationDateLink($share);
997997
$expirationDateUpdated = true;
998998
}
999999
} elseif ($share->getShareType() === \OCP\Share::SHARE_TYPE_EMAIL) {

0 commit comments

Comments
 (0)