aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Files/FilenameValidatorTest.php
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2025-06-17 12:25:54 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2025-06-18 09:44:57 +0200
commit35a27b5fd571bc6cb05126fd828a58a3fa71f081 (patch)
tree9c908258bc827d9c2cbff17ed8465aa9dc9cd3be /tests/lib/Files/FilenameValidatorTest.php
parent3bc4e0ff28e4764a02c7ea456c577bf16a3b9062 (diff)
downloadnextcloud-server-fix/validation-defaults.tar.gz
nextcloud-server-fix/validation-defaults.zip
fix(FilenameValidator): use `_` as default replacement for invalid charsfix/validation-defaults
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'tests/lib/Files/FilenameValidatorTest.php')
-rw-r--r--tests/lib/Files/FilenameValidatorTest.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/lib/Files/FilenameValidatorTest.php b/tests/lib/Files/FilenameValidatorTest.php
index a52971d109e..a4951c2efd3 100644
--- a/tests/lib/Files/FilenameValidatorTest.php
+++ b/tests/lib/Files/FilenameValidatorTest.php
@@ -438,7 +438,7 @@ class FilenameValidatorTest extends TestCase {
'.thumbs.db', ['.htaccess'], ['.thumbs'], [], [], '.thumbs (renamed).db'
],
'invalid character' => [
- 'a: b.txt', ['.htaccess'], [], [], [':'], 'a b.txt',
+ 'a: b.txt', ['.htaccess'], [], [], [':'], 'a_ b.txt',
],
'invalid extension' => [
'a: b.txt', ['.htaccess'], [], ['.txt'], [], 'a: b'
@@ -492,13 +492,13 @@ class FilenameValidatorTest extends TestCase {
public static function dataSanitizeFilenameCharacterReplacement(): array {
return [
'default' => [
- 'foo*bar', ['*'], null, 'foo bar'
+ 'foo*bar', ['*'], null, 'foo_bar'
],
- 'default - space not allowed' => [
- 'foo*bar', ['*', ' '], null, 'foo_bar'
+ 'default - underscore not allowed' => [
+ 'foo*bar', ['*', '_'], null, 'foo-bar'
],
- 'default - space and underscore not allowed' => [
- 'foo*bar', ['*', ' ', '_'], null, 'foo-bar'
+ 'default - dash and underscore not allowed' => [
+ 'foo*bar', ['*', '-', '_'], null, 'foo bar'
],
'default - no replacement' => [
'foo*bar', ['*', ' ', '_', '-'], null, null