Skip to content

Commit

Permalink
slug validator
Browse files Browse the repository at this point in the history
  • Loading branch information
iesreza committed Feb 27, 2025
1 parent dfa56a4 commit 13f87ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/validation/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func slugValidator(match []string, value *generic.Value) error {
return nil
}
var re = regexp.MustCompile(`(?m)^[a-z0-9_-]{1,200}$`)
if re.MatchString(v) {
if !re.MatchString(v) {
return fmt.Errorf("slug can contain only lowercase letters, numbers, hyphens, underscores, and must be between 1 and 200 characters long")
}
return nil
Expand Down

0 comments on commit 13f87ff

Please sign in to comment.