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

TypeError in Illuminate\Routing\RoutingServiceProvider::registerPsrRequest #48822

Closed
kpicaza opened this issue Oct 25, 2023 · 1 comment · Fixed by #48823
Closed

TypeError in Illuminate\Routing\RoutingServiceProvider::registerPsrRequest #48822

kpicaza opened this issue Oct 25, 2023 · 1 comment · Fixed by #48823

Comments

@kpicaza
Copy link
Contributor

kpicaza commented Oct 25, 2023

Laravel Version

10.29.0

PHP Version

8.2

Database Driver & Version

No response

Description

Illuminate\Routing\RoutingServiceProvider::registerPsrRequest is passing a potentially null value to the array_merge function on merging requests' parsed body with the Illuminate request payload. It causes a TypeError exception. I'm already working on a PR fixing it

Steps To Reproduce

  1. Using PSR-7 Bridge
  2. Make a request without parameters, at least with the "content-type" header. For instance:
$client->get('/', [
    'content-type' => 'application/json'
])
  1. ServerRequestInterface $request::getParsedBody will be null
  2. array_merge expect value of type array
    TypeError: array_merge(): Argument #1 must be of type array, null given
@timacdonald
Copy link
Member

Will close this and we can track it in the PR. Thanks!

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 a pull request may close this issue.

2 participants