-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update user share must use correct expiration validation #26200
Update user share must use correct expiration validation #26200
Conversation
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>
@@ -975,15 +975,15 @@ public function updateShare(IShare $share) { | |||
|
|||
if ($share->getExpirationDate() != $originalShare->getExpirationDate()) { | |||
//Verify the expiration date | |||
$this->validateExpirationDate($share); | |||
$this->validateExpirationDateInternal($share); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the actual fix
$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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here
/backport to stable21 |
/backport to stable20 |
/backport to stable19 |
@@ -459,7 +459,7 @@ protected function validateExpirationDateInternal(IShare $share) { | |||
* @throws \InvalidArgumentException | |||
* @throws \Exception | |||
*/ | |||
protected function validateExpirationDate(IShare $share) { | |||
protected function validateExpirationDateLink(IShare $share) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
protected function validateExpirationDateLink(IShare $share) { | |
protected function validateLinkExpirationDate(IShare $share) { |
if that makes it a tad clearer. just an idea :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the other one is called validateLinkExpirationDateInternal
so I'd have to rename it also everywhere...
nah... another time, but thanks for the suggestion
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".
Fixes #26197