1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-04 14:46:57 -05:00

Shrink openEmailBracketIdx -> openBracketIdx

This commit is contained in:
Kemal Zebari 2024-05-11 16:09:40 -07:00
parent cce78121ff
commit 25a9f121b5

View File

@ -229,17 +229,17 @@ func parseCoAuthorTrailerValue(value string) (name, email string, err error) {
}
closedBracketIdx := len(value) - 1
openEmailBracketIdx := strings.LastIndex(value, "<")
if openEmailBracketIdx == -1 {
openBracketIdx := strings.LastIndex(value, "<")
if openBracketIdx == -1 {
return "", "", errSyntax
}
email = value[openEmailBracketIdx+1 : closedBracketIdx]
email = value[openBracketIdx+1 : closedBracketIdx]
if _, err := mail.ParseAddress(email); err != nil {
return "", "", err
}
name = strings.TrimSpace(value[:openEmailBracketIdx])
name = strings.TrimSpace(value[:openBracketIdx])
if len(name) == 0 {
return "", "", errSyntax
}