Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GPG email checking to be case insensitive #1988

Merged
merged 1 commit into from
Jun 17, 2017

Conversation

lafriks
Copy link
Member

@lafriks lafriks commented Jun 16, 2017

Fix #1986

@@ -213,7 +213,7 @@ func parseGPGKey(ownerID int64, e *openpgp.Entity) (*GPGKey, error) {
for _, ident := range e.Identities {

for _, e := range userEmails {
if e.Email == ident.UserId.Email && e.IsActivated {
if e.Email == strings.ToLower(strings.TrimSpace(ident.UserId.Email)) && e.IsActivated {
Copy link
Member

@sapk sapk Jun 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For little performance gain maybe cache strings.ToLower(strings.TrimSpace()) result in a tmp variable and not do it at each userEmails.

@sapk
Copy link
Member

sapk commented Jun 16, 2017

A little performance remark but otherwise LGTM.

@tboerger tboerger added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Jun 16, 2017
@lunny lunny added this to the 1.2.0 milestone Jun 17, 2017
@lunny lunny added the type/bug label Jun 17, 2017
@lafriks
Copy link
Member Author

lafriks commented Jun 17, 2017

Fixed suggested changes and added unit test

@lunny
Copy link
Member

lunny commented Jun 17, 2017

LGTM

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jun 17, 2017
@lunny lunny merged commit 1a906f8 into go-gitea:master Jun 17, 2017
@lafriks lafriks deleted the patch-1 branch June 21, 2017 06:09
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

E-Mail verifcation is case sensitive but all emails are added lowercase
4 participants