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

[9.x] Create new Json ParameterBag Instance when cloning Request #44671

Merged
merged 1 commit into from
Oct 20, 2022
Merged

[9.x] Create new Json ParameterBag Instance when cloning Request #44671

merged 1 commit into from
Oct 20, 2022

Conversation

kohlerdominik
Copy link
Contributor

@kohlerdominik kohlerdominik commented Oct 20, 2022

When creating a new Request instance by createFrom, all attributes of the request get copied to a new InputBag-instance (Request:444-450)

The only exception is the $json-attribute: there, the object of the old instance ($from) get referenced. This means, if the ParameterBag is modified in the new instance, this change also applies in the old instance. I do not think, that this behavior is intended. For me, it was certainly unexpected.

This PR would fix this issue quite straight forward by simply cloning the ParameterBag instance. If another type of implementation is desired to fix this, please let me know.

@taylorotwell taylorotwell merged commit 1661857 into laravel:9.x Oct 20, 2022
@GrahamCampbell GrahamCampbell changed the title [Bugfix] Create new Json ParameterBag Instance when cloning Request [9.x] Create new Json ParameterBag Instance when cloning Request Nov 6, 2022
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