-
Notifications
You must be signed in to change notification settings - Fork 731
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
Update regex for email address to be aligned on RFC 5322 #8671
Update regex for email address to be aligned on RFC 5322 #8671
Conversation
Signed-off-by: yostyle [email protected] |
b34b3fa
to
b9535ac
Compare
@@ -29,7 +30,7 @@ inline fun <T> T.ooi(block: (T) -> Unit): T = also(block) | |||
/** | |||
* Check if a CharSequence is an email. | |||
*/ | |||
fun CharSequence.isEmail() = Patterns.EMAIL_ADDRESS.matcher(this).matches() | |||
fun CharSequence.isEmail() = this.isEmail() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading it from GitHub, it looks like an infinite loop (it's maybe one?).
Maybe remove this extension for clarity. The call site can import org.matrix.android.sdk.api.extensions.isEmail
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I removed this extension.
Signed-off-by: yostyle <[email protected]>
b9535ac
to
3d7489c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Type of change
Content
Update regex for email address to be aligned on RFC 5322
Similar to Matrix React SDK
Motivation and context
Some characters in email address are not allowed in Element Android but should be accepted according to RFC 5322.
Tested devices
Checklist