-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
[stable33] Add repair step for share targets with excess (2) #57858
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
base: stable33
Are you sure you want to change the base?
Conversation
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
…e positives Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
70ecabc to
2cf7599
Compare
| $this->shareManager->moveShare($share, $recipient->getUID()); | ||
|
|
||
| $this->shareTargetValidator->verifyMountPoint( |
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.
I’m surprised by the order here, verifyMountPoint may change the share target, so the moveShare call should happen afterwards, no?
| $query = $this->connection->getQueryBuilder(); | ||
| $query->select('id', 'share_type', 'share_with') | ||
| ->from('share') | ||
| ->where($query->expr()->like('file_target', $query->createNamedParameter('% (2) (2)%'))) |
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.
To cover more cases:
| ->where($query->expr()->like('file_target', $query->createNamedParameter('% (2) (2)%'))) | |
| ->where($query->expr()->like('file_target', $query->createNamedParameter('% (_) (_)%'))) |
| } | ||
|
|
||
| private function cleanTarget(string $target): string { | ||
| return preg_replace('/ \(2\)+/', '', $target); |
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.
To match the above suggestion:
| return preg_replace('/ \(2\)+/', '', $target); | |
| return preg_replace('/ \([2-9]\)+/', '', $target); |
Requires:
Todo: