-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
Method explodeExplicitRule working wrong with regex rule #45520
Comments
Ping @stevebauman. Seems to be because of the changes made here? #40941 @du-nong-028 can you confirm that reverting that PR fixes your issue? |
Thanks for the ping @driesvints! Looking into this now. |
@driesvints Thank you, I confirm that It's working when I revert that PR #40941
When reverting that PR
|
Thanks @du-nong-028, I appreciate the detail in your report 🙏 . I've submitted a PR that reverts the changes and restores documented behaviour. |
Description:
Method explodeExplicitRule works wrong with this rule
regex:/^[\d\-]*$/|max:20
.It can not explodes this rule to two patterns like
I have verified it in Laravel 8 and It has worked perfectly.
I saw Laravel 9 had changed explodeExplicitRule which made it wrong.
In another rule like
required|regex:/^[\d\-]*$/|max:20
or just rotate it likemax:20|regex:/^[\d\-]*$/
,It works perfectly.
https://github.com/laravel/framework/blob/9.x/src/Illuminate/Validation/ValidationRuleParser.php#L86-L103
https://github.com/laravel/framework/blob/8.x/src/Illuminate/Validation/ValidationRuleParser.php#L84-L93
Steps To Reproduce:
use Laravel validator with rule
regex:/^[\d\-]*$/|max:20
The text was updated successfully, but these errors were encountered: