Home › Forums › Quform WordPress › Allow IDNs in Email-Validation
- This topic has 5 replies, 2 voices, and was last updated 8 years, 5 months ago by Ally.
- AuthorPosts
- November 19, 2015 at 11:57 am #17490mdvParticipant
Hi. Currently Quform seems not to allow IDNs for Email-Addresses. That’s rather annoying as there are users that are using such Email-Addresses in our setup. Any chance to get around that issue?
Thanks
November 20, 2015 at 4:28 pm #17498AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
November 24, 2015 at 8:40 am #17510mdvParticipantI’d love to use the RegEx validator, but I seem not to be able to add that to the Email-field. In the advanced settings I can only add an Email-Validator. There’s no RegEx-Validator available. What am I doing wrong?
November 24, 2015 at 9:26 am #17511AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
November 24, 2015 at 9:36 am #17512mdvParticipantGreat!
I’ve also found a way to validate IDN-emails thanks to http://sabel.bluegfx.de/tag/umlaute/.
function _validate_email($valid, $value, $element){ $parts = explode('@', $value); if (2 != count($parts)) { $element->addError('hard to image an email-address without an @'); return false; } if (! filter_var($parts[0] . '@' . idn_to_ascii($parts[1]), FILTER_VALIDATE_EMAIL)) { $valid = false; $element->addError('please provide a valid email-address'); } return $valid; }
Only drawback is that it requires the intl-package in PHP…
November 24, 2015 at 4:17 pm #17516AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- AuthorPosts
- You must be logged in to reply to this topic.