mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-07-16 06:28:50 +00:00
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:
parent
f4450f5015
commit
aae19e6c19
5 changed files with 123 additions and 100 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue