aboutsummaryrefslogtreecommitdiffstats
path: root/models/repo/topic.go
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-08-03 17:18:06 +0800
committerGitHub <noreply@github.com>2023-08-03 09:18:06 +0000
commit539015403f80326d662e31cf9d3a459b3efefcd7 (patch)
tree8738c457c8f245aeae2201157d2a5f44fafe6125 /models/repo/topic.go
parentcad22512b8948fa52e1684ec30bb5a6e5d427d5f (diff)
downloadgitea-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.go2
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 {