Skip to content

NoSuspiciousCharacters does NOT recognize zero-width spaces #62338

@D3strukt0r

Description

@D3strukt0r

Symfony version(s) affected

7.3.4

Description

https://symfony.com/doc/current/reference/constraints/NoSuspiciousCharacters.html

[...] such as invisible characters such as zero-width spaces [...]

I have debugged through the validator and recreated what the validator does in 3v4l

https://3v4l.org/9dMTh#v8.4.14

as you can see, the "default" validator" basically ignore the zero-width space (https://zerowidthspace.me/ -> \u{200b}), that should probably not be the case

we are on PHP v8.4.14 & ICU v72.1

Image

How to reproduce

https://3v4l.org/9dMTh#v8.4.14

class UpdateName
{
    #[Assert\NoSuspiciousCharacters]
    public string $firstname;
}
framework:
    enabled_locales:
        - de
        - fr
        - it

Possible Solution

No response

Additional Context

No response

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