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

Avoid no-url index in stream_get_meta_data #413

Merged
merged 2 commits into from Apr 24, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Utils.php
Expand Up @@ -317,7 +317,8 @@ public static function streamFor($resource = '', array $options = [])
* The 'php://input' is a special stream with quirks and inconsistencies.
* We avoid using that stream by reading it into php://temp
*/
if (\stream_get_meta_data($resource)['uri'] === 'php://input') {
$metaData = \stream_get_meta_data($resource);
if (array_key_exists('uri', $metaData) && $metaData['uri'] === 'php://input') {
GrahamCampbell marked this conversation as resolved.
Show resolved Hide resolved
$stream = self::tryFopen('php://temp', 'w+');
fwrite($stream, stream_get_contents($resource));
fseek($stream, 0);
Expand Down