-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Rendering: Email addresses don't start with a special char (do they?) #27847
Comments
Hi, I would offer my time to help fix this, if this is something suitable for first timer to gitea? |
Seems like a good first issue. Changing the regexp and adding a test like this PR will probably solve the problem. |
Thanks for the pointer. I will take care of it, you can assign it to me if you want. |
Valid email addresses should start with alphanumeric character.
Sorry for the delay. I modified the regular expression to allow emails only to start with alphanumeric character, and few test cases from the bug report, validating that these are no longer rendered as valid email addresses. Please let me know, if anything needs update, or if I have missed something, and I ll take care of it. |
Regular expression will attempt to match valid portion of the email which start with ~,* or ? or their combination.
FYI: actually
|
According to https://stackoverflow.com/questions/201323/how-can-i-validate-an-email-address-using-a-regular-expression, |
I have no preference for either choice. But if we'd like to improve it, it needs enough comments and test cases to document the behavior and how the decision was made. |
Description
Related to #27616.
Email addresses can only start with an alphanumeric character. Hence these are not valid email addresses:
However, Gitea renders them as such:
The
mailto
link should only start at thea
. GitHub handles this correctly:?[email protected]
~[email protected]
*[email protected]
~[email protected]
Gitea Version
1.22.0+dev-262-gec0c6829d
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
https://try.gitea.io/
Database
None
The text was updated successfully, but these errors were encountered: