mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-28 21:11:44 -05:00
parent
17055d1fa7
commit
2d217cba51
2 changed files with 2 additions and 1 deletions
|
@ -102,7 +102,7 @@ func (p *PathSpec) UnicodeSanitize(s string) string {
|
||||||
)
|
)
|
||||||
|
|
||||||
for i, r := range source {
|
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 || unicode.IsLetter(r) || unicode.IsDigit(r) || unicode.IsMark(r)
|
||||||
isAllowed = isAllowed || (r == '%' && i+2 < len(source) && ishex(source[i+1]) && ishex(source[i+2]))
|
isAllowed = isAllowed || (r == '%' && i+2 < len(source) && ishex(source[i+1]) && ishex(source[i+2]))
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,7 @@ func TestMakePath(t *testing.T) {
|
||||||
{"this+is+a+test", "this+is+a+test", false}, // Issue #1290
|
{"this+is+a+test", "this+is+a+test", false}, // Issue #1290
|
||||||
{"~foo", "~foo", false}, // Issue #2177
|
{"~foo", "~foo", false}, // Issue #2177
|
||||||
{"foo--bar", "foo--bar", true}, // Issue #7288
|
{"foo--bar", "foo--bar", true}, // Issue #7288
|
||||||
|
{"foo@bar", "foo@bar", true}, // Issue #10548
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
|
|
Loading…
Reference in a new issue