8000 Do not validate null values in UserPassword\UniqueEntity validators · Issue #23319 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Do not validate null values in UserPassword\UniqueEntity validators #23319
Closed
@szymach

Description

@szymach
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? yes
Symfony version Checked on 3.2, I assume it is for 3.* in general

Hello,
I have ran into an issue when using the Symfony\Component\Security\Core\Validator\Constraints\UserPassword validator and PHP 7.1 - if the field value is empty (a null), the validator breaks on this line with a warning hash_equals(): Expected user_string to be a string, null given.

Usually validators simply check the value for a null and return if found, but here it just passes it on further and allows it to break. Same goes for Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntityValidator and it requires me to overwrite these classes and manually add a check for null. I can make a PR fixing this, assuming everyone is fine with this change.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0