Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Validator] CharsetValidator throws TypeError when the value has an invalid charset #56805

Closed
ludekbenedik opened this issue May 19, 2024 · 0 comments · Fixed by #56827
Closed

Comments

@ludekbenedik
Copy link

Symfony version(s) affected

7.1.0-RC1

Description

In CharsetValidator.php line 41:

[TypeError]
implode(): Argument 2 ($array) must be of type ?array, string given

How to reproduce

$this->validator->validate(substr('á', 0, 1), new Assert\Charset('UTF-8'));

Possible Solution

CharsetValidator.php line 41: ->setParameter('{{ encodings }}', implode(', ', (array) $constraint->encodings))

Additional Context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants