Skip to content

Commit

Permalink
Merge branch 'keyring_emailcheck' into firefox_v3
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Oberndörfer committed Dec 18, 2014
2 parents 0bb9cfa + a642640 commit df648d6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/keyring/keyring.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,10 @@ KeyArray.prototype.getForAddress = function(email) {
* @return {Boolean} True if the email address is defined in the specified key
*/
function emailCheck(email, key) {
email = email.toLowerCase();
var emailRegex = new RegExp('<' + email.toLowerCase() + '>');
var keyEmails = key.getUserIds();
for (var i = 0; i < keyEmails.length; i++) {
//we need to get just the email from the userid key
keyEmail = keyEmails[i].split('<')[1].split('>')[0].trim().toLowerCase();
if (keyEmail == email) {
if (emailRegex.test(keyEmails[i].toLowerCase())) {
return true;
}
}
Expand Down

0 comments on commit df648d6

Please sign in to comment.