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:
parent
5df4876b89
commit
652193711d
1 changed files with 3 additions and 4 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue