1
0
Fork 0
mirror of https://github.com/alice-lg/birdwatcher.git synced 2025-03-09 00:00:05 +01:00

fix charset validator on utf-8

This commit is contained in:
hellerve 2016-12-06 14:26:47 +01:00
parent 5df4876b89
commit 652193711d

View file

@ -17,11 +17,10 @@ func ValidateLength(value string, maxLength int) error {
}
func ValidateCharset(value string, alphabet string) error {
for i := 0; i < len(value); i++ {
c := value[i]
for _, check := range value {
ok := false
for j := 0; j < len(alphabet); j++ {
if alphabet[j] == c {
for _, char := range alphabet {
if char == check {
ok = true
break
}