Skip to content

Commit

Permalink
helpers: Allow at signs in UnicodeSanitize (note)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmooring authored Dec 19, 2022
1 parent 17055d1 commit 2d217cb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion helpers/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (p *PathSpec) UnicodeSanitize(s string) string {
)

for i, r := range source {
isAllowed := r == '.' || r == '/' || r == '\\' || r == '_' || r == '#' || r == '+' || r == '~' || r == '-'
isAllowed := r == '.' || r == '/' || r == '\\' || r == '_' || r == '#' || r == '+' || r == '~' || r == '-' || r == '@'
isAllowed = isAllowed || unicode.IsLetter(r) || unicode.IsDigit(r) || unicode.IsMark(r)
isAllowed = isAllowed || (r == '%' && i+2 < len(source) && ishex(source[i+1]) && ishex(source[i+2]))

Expand Down
1 change: 1 addition & 0 deletions helpers/path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func TestMakePath(t *testing.T) {
{"this+is+a+test", "this+is+a+test", false}, // Issue #1290
{"~foo", "~foo", false}, // Issue #2177
{"foo--bar", "foo--bar", true}, // Issue #7288
{"foo@bar", "foo@bar", true}, // Issue #10548
}

for _, test := range tests {
Expand Down

0 comments on commit 2d217cb

Please sign in to comment.