-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Constraint REGEX htmlPattern
cannot be a boolean.
#53807
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
Comments
Looking at the code, you can also set it to an empty string for that I'm not sure how we want to solve this inconsistency between the type that has been added in the code and the documentation. Looking in the history, support for passing |
Ok for a "workaround", but I don't think it's a "normal way" to think if you want this behavior. |
The problem is |
The related docs have been fixed in symfony/symfony-docs#20089 I reopen the issue because I don't know if there are still some code changes that need to be made to fix this. Thanks. |
Let’s close here. Since the constraint class isn’t final changing the property type isn’t easily possible and thus not worth the effort IMO. |
Symfony version(s) affected
6.4.3
Description
Doc says that we can pass
false
tohtmlPattern
parameter, but in reality this is not the case.https://symfony.com/doc/6.4/reference/constraints/Regex.html#htmlpattern
Class:
https://github.com/symfony/validator/blob/03b0c75d7d3df1ef9a0fd9fb8db1e86f83ffa2bb/Constraints/Regex.php#L39
How to reproduce
Possible Solution
Allow
boolean
orfalse
type onhtmlPattern
parameter.Additional Context
No response
The text was updated successfully, but these errors were encountered: