refactor: Use IFilenameValidator for all filename validation and remove other validation code#46375
Closed
refactor: Use IFilenameValidator for all filename validation and remove other validation code#46375
IFilenameValidator for all filename validation and remove other validation code#46375Conversation
4 tasks
7e4fdb8 to
5d3a0ae
Compare
58f457b to
ee7ad79
Compare
susnux
commented
Jul 9, 2024
| $newPath = $parentPath . '/' . $newName; | ||
|
|
||
| // verify path of the target | ||
| $this->verifyPath($newPath); |
Contributor
Author
There was a problem hiding this comment.
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)
susnux
commented
Jul 9, 2024
| 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], []], |
Contributor
Author
There was a problem hiding this comment.
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)
91820db to
46f1efa
Compare
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
…ameValidator` Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
ee7ad79 to
27eabe3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
IFilenameValidatorto have one consistent place for filename validation #46371Summary
This will migrate all filename validation from custom code to
IFilenameValidatorChecklist