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

fix: [Validation] DotArrayFilter returns incorrect array when numeric index array is passed #8425

Merged
merged 1 commit into from
Jan 18, 2024
Merged

Conversation

grimpirate
Copy link
Contributor

@grimpirate grimpirate commented Jan 16, 2024

Description
Supersedes #8414

The use of array_merge_recursive rewrites numerically indexed values when attempting to retrieve validated data. Use of the array_replace_recursive preserves their ordering. For an in-depth explanation and test harness. There appears to be a similar issue in Laravel.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

The use of array_merge_recursive rewrites numerically indexed values when attempting to retrieve validated data. Use of the array_replace_recursive function preserves their ordering. Unit test demonstrates the failure of array_merge_recursive's use rather than array_replace_recursive
@kenjis kenjis added the bug Verified issues on the current code behavior or pull requests that will fix them label Jan 17, 2024
Copy link
Member

@kenjis kenjis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@kenjis kenjis merged commit 0788018 into codeigniter4:develop Jan 18, 2024
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants