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

[11.x] Fix: Handles non nested explode of multiple Date and Numeric rules in ValidationRuleParser #54718

Conversation

AlexandreMeledandri
Copy link
Contributor

This PR fixes #54717

Problem
The current code in ValidationRuleParser explodeExplicitRule function does not handles the explode for multiple chained non-nested Date or Numeric Rule objects. It falls into the condtion that checks if the rule is an object and wraps the rule in an array as a string cast without exploding it at the pipe symbol.

Fix Implementation

My fix simply add an early exit condition for Date or Numeric rules in the logic if block for objects.
I added some test coverage for the problematic conditions.

I thought of checking against the Stringable interface but it may not be safe enough.

Please let me know if you need any changes to the fix.

Thanks !

@AlexandreMeledandri
Copy link
Contributor Author

AlexandreMeledandri commented Feb 19, 2025

Test for php 8.3 is failing due to a file permission error in an unrelated test. Any idea why ?

1) Illuminate\Tests\Integration\Console\CommandSchedulingTest::testExecutionOrder with data set "Background" (true, ['foreground:before', 'handled', 'background:after'])
ErrorException: file_put_contents(D:\a\framework\framework\vendor\orchestra\testbench-core\laravel\artisan): Failed to open stream: Permission denied

@taylorotwell taylorotwell merged commit 1f5e383 into laravel:11.x Feb 19, 2025
44 of 46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ValidationRuleParser does not handles the explode for multiple chained non-nested Date or Numeric Rule objects
2 participants