-
Notifications
You must be signed in to change notification settings - Fork 21
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
Escape RegExp characters in e-mail in keyCheck() function #92
Comments
Hey 👋 Good catch! Yeah, a PR would be welcome. Instead of escaping the regex, you could also just check directly whether the string contains the email (e.g. using |
I guess pmcrypto aims to be compatible out of the box with IE, but with a String.prototype polyfill, we could use endsWith which would be the more appropriate tool IMO. |
I see |
Unfortunately we can't, because while |
No problem, |
👍 Good point :) Thanks for the PR! I will look at it soon(TM). |
Hello!
By looking at the code at https://github.com/ProtonMail/pmcrypto/blob/master/lib/key/check.js#L18 I assume that if
info.user.userId
ends with"<jackyblack@foo.com>"
andemail
is"jack.black@foo.com"
, it would match as.
is any character in regular expression.I think this would trigger unwanted behaviors.
If my analyse sounds correct to you, you can assign this issue to me and I will propose a PR to escape this
email
variable.The text was updated successfully, but these errors were encountered: