|
|
|
@ -438,7 +438,7 @@ class FilenameValidatorTest extends TestCase {
|
|
|
|
'.thumbs.db', ['.htaccess'], ['.thumbs'], [], [], '.thumbs (renamed).db'
|
|
|
|
'.thumbs.db', ['.htaccess'], ['.thumbs'], [], [], '.thumbs (renamed).db'
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'invalid character' => [
|
|
|
|
'invalid character' => [
|
|
|
|
'a: b.txt', ['.htaccess'], [], [], [':'], 'a b.txt',
|
|
|
|
'a: b.txt', ['.htaccess'], [], [], [':'], 'a_ b.txt',
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'invalid extension' => [
|
|
|
|
'invalid extension' => [
|
|
|
|
'a: b.txt', ['.htaccess'], [], ['.txt'], [], 'a: b'
|
|
|
|
'a: b.txt', ['.htaccess'], [], ['.txt'], [], 'a: b'
|
|
|
|
@ -492,13 +492,13 @@ class FilenameValidatorTest extends TestCase {
|
|
|
|
public static function dataSanitizeFilenameCharacterReplacement(): array {
|
|
|
|
public static function dataSanitizeFilenameCharacterReplacement(): array {
|
|
|
|
return [
|
|
|
|
return [
|
|
|
|
'default' => [
|
|
|
|
'default' => [
|
|
|
|
'foo*bar', ['*'], null, 'foo bar'
|
|
|
|
'foo*bar', ['*'], null, 'foo_bar'
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'default - space not allowed' => [
|
|
|
|
'default - underscore not allowed' => [
|
|
|
|
'foo*bar', ['*', ' '], null, 'foo_bar'
|
|
|
|
'foo*bar', ['*', '_'], null, 'foo-bar'
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'default - space and underscore not allowed' => [
|
|
|
|
'default - dash and underscore not allowed' => [
|
|
|
|
'foo*bar', ['*', ' ', '_'], null, 'foo-bar'
|
|
|
|
'foo*bar', ['*', '-', '_'], null, 'foo bar'
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'default - no replacement' => [
|
|
|
|
'default - no replacement' => [
|
|
|
|
'foo*bar', ['*', ' ', '_', '-'], null, null
|
|
|
|
'foo*bar', ['*', ' ', '_', '-'], null, null
|
|
|
|
|