Allow IDNs in Email-Validation

Home Forums Quform WordPress Allow IDNs in Email-Validation

This topic is: not resolved
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #17490
    mdv
    Participant

    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

    #17498
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #17510
    mdv
    Participant

    I’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?

    #17511
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #17512
    mdv
    Participant

    Great!

    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…

    • This reply was modified 8 years, 5 months ago by mdv.
    • This reply was modified 8 years, 5 months ago by mdv.
    • This reply was modified 8 years, 5 months ago by mdv.
    #17516
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy