Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Email assert passes empty string #10357

Copy link
Copy link
Closed
@yuri-karkh

Description

@yuri-karkh
Issue body actions
    /**
     * @var string
     * @ORM\Column(name="email", type="string", length=100, unique=true)
     * @Assert\Email(
	 *     message="Email is not valid",
	 *     mode="html5"
	 * )
     */
    private $email;

passing empty string as an email passed validation. var_dump of the $validator->validate( $object ); is below.

object(Symfony\Component\Validator\ConstraintViolationList)#3636 (1) {
 ["violations":"Symfony\Component\Validator\ConstraintViolationList":private]=>
 array(0) {
 }
}

Also found similar issue here:
#4244

I can confirm that if use together with NotBlank() constraint Email() constraint works as expected. So not very obvious behaviour of assertion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ValidatorhasPRA Pull Request has already been submitted for this issue.A Pull Request has already been submitted for this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.