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

[8.x] TransformsRequest.php cleanArray function fix #36002

Merged
merged 1 commit into from
Jan 22, 2021

Conversation

ozgurkadarozgur
Copy link
Contributor

When I send a request which has nested json body fields this function does recursive operation and it throws 'maximum function nested level of 256 reached.'.
Size of my data is less than 256.
If I use foreach loop it does not make recursive operation.

My request:
{"sample1":"sample","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}],"sample2":[{"sample3":"sample","name":"sample"}]}

When I send a request which has nested json body fields this function does recursive operation and it throws 'maximum function nested level of 256 reached.'.
Size of my data is less than 256.
If I use foreach loop it does not make recursive operation.

My request:
{"sample1":"sample","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[{"title":"aa","children":[]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}],"sample2":[{"sample3":"sample","name":"sample"}]}
@taylorotwell taylorotwell merged commit cc03df3 into laravel:8.x Jan 22, 2021
@GrahamCampbell GrahamCampbell changed the title TransformsRequest.php cleanArray function fix. [8.x] TransformsRequest.php cleanArray function fix Jan 22, 2021
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.

2 participants