Skip to content

Commit 918f813

Browse files
Fix Psr17Factory::createServerRequestFromGlobals() when uploaded files have been moved
1 parent 786d27f commit 918f813

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- [#230](https://github.com/php-http/discovery/pull/230) - Add Psr18Client to make it straightforward to use PSR-18
66
- [#232](https://github.com/php-http/discovery/pull/232) - Allow pinning the preferred implementations in composer.json
7+
- [#233](https://github.com/php-http/discovery/pull/233) - Fix Psr17Factory::createServerRequestFromGlobals() when uploaded files have been moved
78

89
## 1.16.0 - 2023-04-26
910

src/Psr17Factory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ private function normalizeFiles(array $files): array
283283
private function createUploadedFileFromSpec(array $value)
284284
{
285285
if (!is_array($tmpName = $value['tmp_name'])) {
286-
$file = $this->createStreamFromFile($tmpName, 'r');
286+
$file = is_file($tmpName) ? $this->createStreamFromFile($tmpName, 'r') : $this->createStream();
287287

288288
return $this->createUploadedFile($file, $value['size'], $value['error'], $value['name'], $value['type']);
289289
}

0 commit comments

Comments
 (0)