Language: PHP
Label: vulnerable
CWE: CWE-754 \u2014 Improper Check for Unusual or Exceptional Conditions
The product does not check or incorrectly checks for unusual or exceptional conditions that are not expected to occur frequently during day to day operation of the product.

Code:
    public function isValid($emailAddress)
    {
        // Inspired by the regex used in symfony/validator
        // See: https://github.com/symfony/validator/blob/dae70b74fe173461395cfd61a5c5245e05e511f5/Constraints/EmailValidator.php#L72
        return (bool) preg_match('/^\S+\@\S+\.\S+$/', $emailAddress);
    }