Skip to content
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

fix(files): Reverse logic to prevent copy to itself #41709

Merged
merged 3 commits into from
Nov 27, 2023

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Nov 23, 2023

Summary

If node is /foo/bar.txt then it path is /foo. You should be able to copy it to /.
So to check if copy is allowed check destination.startWith(node.path).

Checklist

@susnux susnux added this to the Nextcloud 29 milestone Nov 23, 2023
@susnux susnux requested review from skjnldsv, Pytal and a team November 23, 2023 20:40
@susnux susnux self-assigned this Nov 23, 2023
@susnux susnux requested review from emoral435 and removed request for a team November 23, 2023 20:40
@susnux
Copy link
Contributor Author

susnux commented Nov 23, 2023

/backport to stable28

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@emoral435 emoral435 merged commit f605906 into master Nov 27, 2023
42 checks passed
@emoral435 emoral435 deleted the fix/files-copy-move-action branch November 27, 2023 19:15
@blizzz blizzz mentioned this pull request Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants