Skip to content

Conversation

@icewind1991
Copy link
Member

@icewind1991 icewind1991 commented Jan 27, 2026

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>
Comment on lines +79 to +81
$this->shareManager->moveShare($share, $recipient->getUID());

$this->shareTargetValidator->verifyMountPoint(
Copy link
Contributor

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)%')))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To cover more cases:

Suggested change
->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);
Copy link
Contributor

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:

Suggested change
return preg_replace('/ \(2\)+/', '', $target);
return preg_replace('/ \([2-9]\)+/', '', $target);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants