chore: tidy up uploading migration code (#12577)
- Validate and sanitize topics. - Cap topics at 25 (limit used elsewhere, now unified constant). - Add more details and rephrase common user-facing error messages. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/12577
This commit is contained in:
@@ -20,6 +20,9 @@ func init() {
|
||||
db.RegisterModel(new(RepoTopic))
|
||||
}
|
||||
|
||||
// MaxTopicsPerRepo caps the amount of topics allowed per repository.
|
||||
const MaxTopicsPerRepo = 25
|
||||
|
||||
var topicPattern = regexp.MustCompile(`^[a-z0-9][-.a-z0-9]*$`)
|
||||
|
||||
// Topic represents a topic of repositories
|
||||
|
||||
Reference in New Issue
Block a user