diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-08-03 17:18:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-03 09:18:06 +0000 |
commit | 539015403f80326d662e31cf9d3a459b3efefcd7 (patch) | |
tree | 8738c457c8f245aeae2201157d2a5f44fafe6125 /models/repo/topic.go | |
parent | cad22512b8948fa52e1684ec30bb5a6e5d427d5f (diff) | |
download | gitea-539015403f80326d662e31cf9d3a459b3efefcd7.tar.gz gitea-539015403f80326d662e31cf9d3a459b3efefcd7.zip |
Fix the topic validation rule and suport dots (#26286)
1. Allow leading and trailing spaces by user input, these spaces have
already been trimmed at backend
2. Allow using dots in the topic
Diffstat (limited to 'models/repo/topic.go')
-rw-r--r-- | models/repo/topic.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/models/repo/topic.go b/models/repo/topic.go index ec3de869d5..71302388b9 100644 --- a/models/repo/topic.go +++ b/models/repo/topic.go @@ -22,7 +22,7 @@ func init() { db.RegisterModel(new(RepoTopic)) } -var topicPattern = regexp.MustCompile(`^[a-z0-9][a-z0-9-]*$`) +var topicPattern = regexp.MustCompile(`^[a-z0-9][-.a-z0-9]*$`) // Topic represents a topic of repositories type Topic struct { |