fix: Invalid UTF-8 commit messages in JSON API responses (#37542) (#37585)

Backport #37542

Co-authored-by: Nicolas <bircni@icloud.com>

---------

Co-authored-by: Nicolas <bircni@icloud.com>
This commit is contained in:
wxiaoguang
2026-05-08 00:22:09 +08:00
committed by GitHub
parent 7d77631881
commit 3004c45607
13 changed files with 22 additions and 21 deletions
+1 -1
View File
@@ -402,7 +402,7 @@ func pushUpdateAddTags(ctx context.Context, repo *repo_model.Repository, gitRepo
}
rel, has := relMap[lowerTag]
title, note := git.SplitCommitTitleBody(tag.Message, 255)
title, note := git.SplitCommitTitleBody(strings.ToValidUTF8(tag.Message, "?"), 255)
if !has {
rel = &repo_model.Release{
RepoID: repo.ID,