Skip to content

Email address starting with double quote passes isEmail validation #2432

@bc-koenvanzuijlen

Description

@bc-koenvanzuijlen

Describe the bug
When an email address string starts with a double quote it seems to pass validation, if the quote is not the first character it fails.

Reproductions

const validator = require("validator");
console.dir(String(validator.isEmail('john"[email protected]')));
console.dir(String(validator.isEmail('"[email protected]')));

Output:

'false'
'true'

Additional context
Validator.js version: 13.12.0
Node.js version: 20.9.0
OS platform: macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions