-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
Validation in / not in breaks with values ending in backslash #50712
Comments
Thank you for reporting this issue! As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub. If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team. Thank you! |
The Validator uses the function But the probleme is here:
|
This might not be a pretty or perfect solution, but it seems to work. protected static function parseParameters($rule, $parameter)
{
return array_map(function ($param) { return str_replace('\\\\', '\\', $param); },
static::ruleIsRegex($rule) ? [$parameter] : str_getcsv(str_replace('\\', '\\\\', $parameter), ',', '"', "\\")
);
} I don't know if there are any security concerns or if this might cause bugs for other cases. But it passes the tests |
Looks like for now, we're not going to support this, sorry. |
Laravel Version
10.29.0
PHP Version
8.2.14
Database Driver & Version
No response
Description
In and NotIn validation rules do not work correctly for values ending in backslash.
Steps To Reproduce
Execute the following tinker commands:
First validator passes, seconds fails as expected. First should fail too.
The text was updated successfully, but these errors were encountered: