-
Notifications
You must be signed in to change notification settings - Fork 46
Psr17Factory::buildServerRequestFromGlobals() throws TypeError when encountering nested array of file uploads #226
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
Comments
from the stack trace, the problem is at the bottom of the factory: discovery/src/Psr17Factory.php Line 269 in 1ce09e7
|
Can you please provide a test case and a fix maybe in a PR? |
Same problem.
|
As far as I can tell, we could simply copy the working logic from guzzlehttp/psr7's ServerRequest class, as there is already a comment mentioning that package and its copyright information. |
Fixed in v1.16.0, thanks for the PR |
PHP version: 8.2.5
Description
PHP allows file uploads to be nested in an arbitrarily deep array structure (see example markup below). For requests using this feature, Psr17Factory::buildServerRequestFromGlobals() throws TypeError: Http\Discovery\Psr17Factory::createStreamFromFile(): Argument ($filename) must be of type string, array given, called in /vendor/php-http/discovery/src/Psr17Factory.php on line 271 in Http\Discovery\Psr17Factory->createStreamFromFile() (line 120 of /vendor/php-http/discovery/src/Psr17Factory.php)
How to reproduce
Uploading a file to this script should throw the TypeError:
Possible Solution
Additional context
Discovered in getsentry/sentry-php#1517
The text was updated successfully, but these errors were encountered: