forked from External/ergo
disallow some bad characters in foldPermissive
This commit is contained in:
parent
0df25e0e30
commit
2d4dbeba1c
2 changed files with 17 additions and 0 deletions
|
|
@ -271,6 +271,11 @@ func IsPureASCII(str string) bool {
|
|||
}
|
||||
|
||||
func foldPermissive(str string) (result string, err error) {
|
||||
for _, r := range str {
|
||||
if unicode.IsSpace(r) || r == 0 {
|
||||
return "", errInvalidCharacter
|
||||
}
|
||||
}
|
||||
// YOLO
|
||||
str = norm.NFD.String(str)
|
||||
str = cases.Fold().String(str)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue