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

isEmail accepts incorrect domain. #2268

Open
itbali opened this issue Aug 17, 2023 · 1 comment · May be fixed by #2287
Open

isEmail accepts incorrect domain. #2268

itbali opened this issue Aug 17, 2023 · 1 comment · May be fixed by #2287
Labels

Comments

@itbali
Copy link

itbali commented Aug 17, 2023

When doing check with isEmail('test@gma--il.com') we receive true, but expected false..

looks like this fixes will be enough:

const default_fqdn_options = {
    require_tld: true,
    allow_underscores: false,
    allow_trailing_dot: false,
    allow_numeric_tld: false,
    allow_wildcard: false,
    ignore_max_length: false,
    disallow_consecutive_hyphens: true,
};

function isFQDN(str, options) {
    assertString(str);
    options = merge(options, default_fqdn_options);

    // ... (other code remains unchanged)

    /* Check for consecutive hyphens in the domain part */
    if (options.disallow_consecutive_hyphens && /--/.test(str)) {
        return false;
    }

    // ... (rest of the code remains unchanged)
}
@kshavp kshavp linked a pull request Sep 19, 2023 that will close this issue
4 tasks
@kshavp
Copy link

kshavp commented Sep 19, 2023

@itbali, I have submitted a PR regarding this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants