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:
parent
cce78121ff
commit
25a9f121b5
@ -229,17 +229,17 @@ func parseCoAuthorTrailerValue(value string) (name, email string, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
closedBracketIdx := len(value) - 1
|
closedBracketIdx := len(value) - 1
|
||||||
openEmailBracketIdx := strings.LastIndex(value, "<")
|
openBracketIdx := strings.LastIndex(value, "<")
|
||||||
if openEmailBracketIdx == -1 {
|
if openBracketIdx == -1 {
|
||||||
return "", "", errSyntax
|
return "", "", errSyntax
|
||||||
}
|
}
|
||||||
|
|
||||||
email = value[openEmailBracketIdx+1 : closedBracketIdx]
|
email = value[openBracketIdx+1 : closedBracketIdx]
|
||||||
if _, err := mail.ParseAddress(email); err != nil {
|
if _, err := mail.ParseAddress(email); err != nil {
|
||||||
return "", "", err
|
return "", "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
name = strings.TrimSpace(value[:openEmailBracketIdx])
|
name = strings.TrimSpace(value[:openBracketIdx])
|
||||||
if len(name) == 0 {
|
if len(name) == 0 {
|
||||||
return "", "", errSyntax
|
return "", "", errSyntax
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user