The wp-comments-post.php
within it is the following line of code:
$comment_author_email = ( isset($_POST['email']) ) ? trim($_POST['email']) : null;
I would like to run it through a filter that converts the domain part of an e-mail address to ASCII punycode so that people posting with IDN e-mail addresses won't be rejected by the core is_email function.
Is this possible?
-=-
Another possibility is to re-define is_email() using the PECL runkit module but I think that's kind of dirty, not sure it even builds on current php.
I would re-define is_email, after it splits the email into local@domain - it could add
if(function_exists('idn_to_ascii') {
$domain=idn_to_ascii($domain);
}
That would at least let IDN domains pass the is_email() test but I still would prefer the e-mail address by ASCII from the start (converted to UTF8 for display in pages), so the best way would be to just modify UTF8 e-mail when the $_POST['email'] is parsed.
Is that possible via a plugin?
Sorry, I am new to WordPress development and still trying to dig through the docs about what is and is not possible.
Thanks for suggestions.