Skip to content

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

Merged
bmarty merged 3 commits into
element-hq:developfrom
yostyle:yostyle/update_email_regex
Nov 14, 2023
Merged

Update regex for email address to be aligned on RFC 5322#8671
bmarty merged 3 commits into
element-hq:developfrom
yostyle:yostyle/update_email_regex

Conversation

@yostyle
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

yostyle commented Oct 23, 2023

Signed-off-by: yostyle y.pintas@gmail.com

@yostyle yostyle force-pushed the yostyle/update_email_regex branch from b34b3fa to b9535ac Compare October 23, 2023 15:35
@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
* Check if a CharSequence is an email.
*/
fun CharSequence.isEmail() = Patterns.EMAIL_ADDRESS.matcher(this).matches()
fun CharSequence.isEmail() = this.isEmail()
Copy link
Copy Markdown
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
Copy Markdown
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.

@yostyle yostyle force-pushed the yostyle/update_email_regex branch from b9535ac to 3d7489c Compare November 14, 2023 11:39
@yostyle yostyle requested a review from bmarty November 14, 2023 11:41
Copy link
Copy Markdown
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
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