We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0bb9cfa + a642640 commit df648d6Copy full SHA for df648d6
1 file changed
src/keyring/keyring.js
@@ -123,12 +123,10 @@ KeyArray.prototype.getForAddress = function(email) {
123
* @return {Boolean} True if the email address is defined in the specified key
124
*/
125
function emailCheck(email, key) {
126
- email = email.toLowerCase();
+ var emailRegex = new RegExp('<' + email.toLowerCase() + '>');
127
var keyEmails = key.getUserIds();
128
for (var i = 0; i < keyEmails.length; i++) {
129
- //we need to get just the email from the userid key
130
- keyEmail = keyEmails[i].split('<')[1].split('>')[0].trim().toLowerCase();
131
- if (keyEmail == email) {
+ if (emailRegex.test(keyEmails[i].toLowerCase())) {
132
return true;
133
}
134
0 commit comments