Skip to content

Commit

Permalink
Merge pull request #26206 from nextcloud/backport/26200/stable19
Browse files Browse the repository at this point in the history
[stable19] Update user share must use correct expiration validation
  • Loading branch information
MorrisJobke authored Mar 19, 2021
2 parents 8670ef7 + ecaa026 commit 64cfaf9
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 45 deletions.
10 changes: 5 additions & 5 deletions lib/private/Share20/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ protected function validateExpirationDateInternal(\OCP\Share\IShare $share) {
* @throws \InvalidArgumentException
* @throws \Exception
*/
protected function validateExpirationDate(\OCP\Share\IShare $share) {
protected function validateExpirationDateLink(\OCP\Share\IShare $share) {
$expirationDate = $share->getExpirationDate();

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

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

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

if ($share->getExpirationDate() != $originalShare->getExpirationDate()) {
//Verify the expiration date
$this->validateExpirationDate($share);
$this->validateExpirationDateInternal($share);
$expirationDateUpdated = true;
}
} elseif ($share->getShareType() === \OCP\Share::SHARE_TYPE_GROUP) {
$this->groupCreateChecks($share);

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

if ($share->getExpirationDate() != $originalShare->getExpirationDate()) {
//Verify the expiration date
$this->validateExpirationDate($share);
$this->validateExpirationDateLink($share);
$expirationDateUpdated = true;
}
} elseif ($share->getShareType() === \OCP\Share::SHARE_TYPE_EMAIL) {
Expand Down
Loading

0 comments on commit 64cfaf9

Please sign in to comment.