mirror of
https://github.com/jeremyd/ergo.git
synced 2026-05-24 08:44:46 -07:00
disallow some bad characters in foldPermissive
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user