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

[#16637] - refactor: allow utf8 in email local part. #16638

Merged

Conversation

noone-silent
Copy link
Contributor

Hello!

In raising this pull request, I confirm the following:

  • I have read and understood the Contributing Guidelines
  • I have checked that another pull request for this purpose does not exist
  • I wrote some tests for this PR
  • I have updated the relevant CHANGELOG
  • I have created a PR for the documentation about this change

Small description of change: Allow UTF8 in local part of the email, if allowUTF8 is true

Thanks

@niden niden added bug A bug report status: medium Medium 5.0 The issues we want to solve in the 5.0 release labels Aug 19, 2024
@niden niden merged commit a733278 into phalcon:5.0.x Aug 19, 2024
50 checks passed
@niden
Copy link
Member

niden commented Aug 19, 2024

Thank you @noone-silent

@s-ohnishi
Copy link

s-ohnishi commented Aug 19, 2024

It seems that you are focusing on internationalization of the local part, but don't you need to consider internationalizing the domain name?

By the way, RFC5336 has been abolished and the revised version is RFC 6531.

@noone-silent
Copy link
Contributor Author

It seems that you are focusing on internationalization of the local part, but don't you need to consider internationalizing the domain name?

By the way, RFC5336 has been abolished and the revised version is RFC 6531.

The domain part with umlauts or non ascii chars is normally not valid and needs to be transformed to ascii through punycode. There is a function in the INTL extension. Non ASCII chars in the local part is totally valid and doesn't need any transformation.

@noone-silent noone-silent deleted the T16637-allow-utf8-email-in-local-part branch August 19, 2024 23:44
@s-ohnishi
Copy link

Non-ASCII characters in the local part are still uncommon (which is why they're disabled by default even with this update, perhaps?), so when considering validation of email addresses that contain non-ASCII characters, it seems unfair to not take the domain part into consideration.
Even though it's non-standard, are you validating it by adding a special flag, and then converting the part to the right of the @ character to punycode before validating it?
I think it's only natural that there would be a request to allow non-ASCII characters in the entire email address, rather than just in the local part.
I would simply like to pass it to the validator (even if a flag is specified).

@noone-silent
Copy link
Contributor Author

noone-silent commented Aug 20, 2024

Non-ASCII characters in the local part are still uncommon (which is why they're disabled by default even with this update, perhaps?), so when considering validation of email addresses that contain non-ASCII characters, it seems unfair to not take the domain part into consideration. Even though it's non-standard, are you validating it by adding a special flag, and then converting the part to the right of the @ character to punycode before validating it? I think it's only natural that there would be a request to allow non-ASCII characters in the entire email address, rather than just in the local part. I would simply like to pass it to the validator (even if a flag is specified).

We could implement this, but that would need the intl extension and I don't know if this is a requirement for Phalcon or if it is usable in Zephir. So if it is not a requirement, it would be a breaking change.

@s-ohnishi
Copy link

I don't know if this is a breaking change or a requirement of some kind.
But I can't imagine that progressive users who want to allow non-ASCII characters in email addresses don't know about IDNs, and would want to use them, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.0 The issues we want to solve in the 5.0 release bug A bug report status: medium Medium
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants