Skip to content

Commit a084bc1

Browse files
[5.x] Remove single quote in Asset upload (statamic#11858)
1 parent eba3079 commit a084bc1

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/Assets/AssetUploader.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ public static function getSafeFilename($string)
8989
'?' => '-',
9090
'*' => '-',
9191
'%' => '-',
92+
"'" => '-',
93+
'--' => '-',
9294
];
9395

9496
return (string) Str::of(urldecode($string))

tests/Assets/AssetUploaderTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ public static function filenameReplacementsProvider()
3131
'question marks' => ['one?two.jpg', 'one-two.jpg'],
3232
'asterisks' => ['one*two.jpg', 'one-two.jpg'],
3333
'percentage' => ['one%two.jpg', 'one-two.jpg'],
34+
'single quote' => ["one'two'three.jpg", 'one-two-three.jpg'],
35+
'double dash' => ['one--two--three.jpg', 'one-two-three.jpg'],
3436
'ascii' => ['fòô-bàř', 'foo-bar'],
3537
];
3638
}

0 commit comments

Comments
 (0)