Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <[email protected]>
  • Loading branch information
PVince81 authored and backportbot[bot] committed Mar 19, 2021
commit 4ad89c17613ebb74fbe4f5241f5b7d55b36997b3
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(IShare $share) {
* @throws \InvalidArgumentException
* @throws \Exception
*/
protected function validateExpirationDate(IShare $share) {
protected function validateExpirationDateLink(IShare $share) {
$expirationDate = $share->getExpirationDate();

if ($expirationDate !== null) {
Expand Down Expand Up @@ -761,7 +761,7 @@ public function createShare(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 @@ -973,15 +973,15 @@ public function updateShare(IShare $share) {

if ($share->getExpirationDate() != $originalShare->getExpirationDate()) {
//Verify the expiration date
$this->validateExpirationDate($share);
$this->validateExpirationDateInternal($share);
$expirationDateUpdated = true;
}
} elseif ($share->getShareType() === IShare::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() === IShare::TYPE_LINK) {
Expand All @@ -997,7 +997,7 @@ public function updateShare(IShare $share) {

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