mirror of
https://github.com/stashapp/stash.git
synced 2026-03-25 14:41:18 +01:00
Merge 5824429f1a into fd480c5a3e
This commit is contained in:
commit
2ff40da1f2
2 changed files with 4 additions and 1 deletions
|
|
@ -148,7 +148,7 @@ func Touch(path string) error {
|
|||
|
||||
var (
|
||||
replaceCharsRE = regexp.MustCompile(`[&=\\/:*"?_ ]`)
|
||||
removeCharsRE = regexp.MustCompile(`[^[:alnum:]-.]`)
|
||||
removeCharsRE = regexp.MustCompile(`[^\p{L}\p{N}\-.]`)
|
||||
multiHyphenRE = regexp.MustCompile(`\-+`)
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,9 @@ func TestSanitiseBasename(t *testing.T) {
|
|||
{"multi-hyphen", `hyphened--name`, "hyphened-name-2da2a58f"},
|
||||
{"replaced characters", `a&b=c\d/:e*"f?_ g`, "a-b-c-d-e-f-g-ffca6fb0"},
|
||||
{"removed characters", `foo!!bar@@and, more`, "foobarand-more-7cee02ab"},
|
||||
{"unicode cjk", `テスト`, "テスト-63b560db"},
|
||||
{"unicode korean", `시험`, "시험-3fcc7beb"},
|
||||
{"mixed unicode", `Test テスト`, "Test-テスト-366aff1e"},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue