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

feat: Add IFilenameValidator to have one consistent place for filename validation #46371

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Jul 9, 2024

Summary

This is the first part, split #45151 to make review easier.

This adds a new interface IFilenameValidator that allows validating filenames to have one consistent location for filename handling.
We need two¹ functions:

  1. Validation with meaningful messages (as errors)
  2. Validation for if with boolean return

¹ We need in some rare private filesystem locations a third function: We need to check if a file is forbidden but can not validate all other restrictions, because we use our filesystem API also for setup where we use possibly forbidden characters as we are only setup Nextcloud itself not files later synced.

Checklist

@susnux susnux added this to the Nextcloud 30 milestone Jul 9, 2024
@susnux susnux requested review from a team, ArtificialOwl, yemkareems, sorbaugh and come-nc and removed request for a team July 9, 2024 11:47
@susnux
Copy link
Contributor Author

susnux commented Jul 9, 2024

Follow up with usage here: #46375

@susnux susnux requested a review from come-nc July 9, 2024 12:35
come-nc

This comment was marked as resolved.

…ame validation

Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux susnux requested a review from come-nc July 9, 2024 13:05
@susnux susnux requested a review from Altahrim July 9, 2024 14:15
@nickvergessen nickvergessen added pending documentation This pull request needs an associated documentation update and removed pending documentation This pull request needs an associated documentation update labels Jul 18, 2024
@blizzz blizzz mentioned this pull request Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants