diff --git a/src/main/kotlin/uk/co/neviyn/booru/Entity.kt b/src/main/kotlin/uk/co/neviyn/booru/Entity.kt index 047de0c..d80f443 100644 --- a/src/main/kotlin/uk/co/neviyn/booru/Entity.kt +++ b/src/main/kotlin/uk/co/neviyn/booru/Entity.kt @@ -8,6 +8,7 @@ import javax.persistence.JoinColumn import javax.persistence.JoinTable import javax.persistence.ManyToMany import javax.persistence.ManyToOne +import javax.validation.constraints.Pattern @Entity open class User( @@ -56,6 +57,7 @@ open class Image( @Entity open class Tag( @Column(unique = true) + @Pattern(regexp = "[a-zA-Z0-9_]*") // Only allow alphanumeric and underscores open var tag: String = "", @Id open var id: Long = -1 ) \ No newline at end of file