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

Update regex for email address to be aligned on RFC 5322 #8671

Merged
merged 3 commits into from
Nov 14, 2023

Conversation

yostyle
Copy link
Contributor

@yostyle yostyle commented Oct 23, 2023

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

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

  • Physical
  • Emulator
  • OS version(s):

Checklist

@yostyle
Copy link
Contributor Author

yostyle commented Oct 23, 2023

Signed-off-by: yostyle [email protected]

@yostyle yostyle marked this pull request as ready for review October 23, 2023 15:46
@bmarty bmarty self-requested a review November 7, 2023 13:08
@@ -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()
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

Thanks!

@bmarty bmarty merged commit 98e09ee into element-hq:develop Nov 14, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Z-Community-PR Issue is solved by a community member's PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants