-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Conversation
7e4fdb8
to
5d3a0ae
Compare
58f457b
to
ee7ad79
Compare
$newPath = $parentPath . '/' . $newName; | ||
|
||
// verify path of the target | ||
$this->verifyPath($newPath); |
There was a problem hiding this comment.
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], []], |
There was a problem hiding this comment.
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)
91820db
to
46f1efa
Compare
Signed-off-by: Ferdinand Thiessen <[email protected]>
…ameValidator` Signed-off-by: Ferdinand Thiessen <[email protected]>
Signed-off-by: Ferdinand Thiessen <[email protected]>
ee7ad79
to
27eabe3
Compare
IFilenameValidator
to have one consistent place for filename validation #46371Summary
This will migrate all filename validation from custom code to
IFilenameValidator
Checklist