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

refactor: Use IFilenameValidator for all filename validation and remove other validation code #46375

Closed
wants to merge 3 commits into from

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Jul 9, 2024

Summary

This will migrate all filename validation from custom code to IFilenameValidator

Checklist

lib/private/legacy/OC_Helper.php Dismissed Show dismissed Hide dismissed
$newPath = $parentPath . '/' . $newName;

// verify path of the target
$this->verifyPath($newPath);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We wanted to verify the target but we were validating the source previously.
This breaks things if you have fileA but that name is now forbidden -> you need to be able to rename it.

(also it was simply wrong)

@@ -397,7 +397,7 @@ public function testMoveFailedInvalidChars($source, $destination, $updatables, $

public function moveFailedInvalidCharsProvider() {
return [
['a/b', 'a/*', ['a' => true, 'a/b' => true, 'a/c*' => false], []],
['a/b', 'a/ ', ['a' => true, 'a/b' => true, 'a/c ' => false], []],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

legacy leftover from when we supported Windows Servers and * was forbidden char, nowadays it is not but so we use a really forbidden char (ascii < 31)

@susnux susnux force-pushed the refactor/use-filename-validator branch from ee7ad79 to 27eabe3 Compare July 9, 2024 13:05
Base automatically changed from feat/filename-validator to master July 10, 2024 13:40
@skjnldsv skjnldsv added the 2. developing Work in progress label Jul 27, 2024
@susnux susnux closed this Aug 24, 2024
@susnux susnux deleted the refactor/use-filename-validator branch August 24, 2024 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants