Skip to content

Commit af96286

Browse files
zeripathlunny
andauthored
Stop sanitizing full name in API (#17396)
The API convert.toUser function makes the incorrect assumption that full names could be rendered as is without being escaped. It therefore runs the names through markup.Sanitize which leads to a double escape of user full names. This pr stops this. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
1 parent 23d3692 commit af96286

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

modules/convert/user.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ package convert
66

77
import (
88
"code.gitea.io/gitea/models"
9-
"code.gitea.io/gitea/modules/markup"
109
api "code.gitea.io/gitea/modules/structs"
1110
)
1211

@@ -49,7 +48,7 @@ func toUser(user *models.User, signed, authed bool) *api.User {
4948
result := &api.User{
5049
ID: user.ID,
5150
UserName: user.Name,
52-
FullName: markup.Sanitize(user.FullName),
51+
FullName: user.FullName,
5352
Email: user.GetEmail(),
5453
AvatarURL: user.AvatarLink(),
5554
Created: user.CreatedUnix.AsTime(),

0 commit comments

Comments
 (0)