pull/664/head
KnifeLemon 2 weeks ago
commit 5ccc8fba98

@ -639,8 +639,7 @@ class Request
$data[$keyName] = [$data[$keyName]]; $data[$keyName] = [$data[$keyName]];
} }
$data[$keyName][] = $value; $data[$keyName][] = $value;
} } else {
else {
$data[$keyName] = $value; $data[$keyName] = $value;
} }
continue; continue;
@ -667,8 +666,7 @@ class Request
if ($bytes === false) { if ($bytes === false) {
$tmpFile['error'] = UPLOAD_ERR_CANT_WRITE; $tmpFile['error'] = UPLOAD_ERR_CANT_WRITE;
} } else {
else {
// delete the temporary file before ended script // delete the temporary file before ended script
register_shutdown_function(function () use ($tmpName): void { register_shutdown_function(function () use ($tmpName): void {
if (file_exists($tmpName)) { if (file_exists($tmpName)) {

@ -63,32 +63,8 @@ class RequestBodyParserTest extends TestCase
private function assertUrlEncodedParsing(string $method): void private function assertUrlEncodedParsing(string $method): void
{ {
$body = 'foo=bar&baz=qux&key=value'; $body = 'foo=bar&baz=qux&key=value';
$tmpfile = tmpfile(); $tmpfile = null;
$stream_path = stream_get_meta_data($tmpfile)['uri']; $config = $this->createRequestConfig($method, 'application/x-www-form-urlencoded', $body, $tmpfile);
file_put_contents($stream_path, $body);
$config = [
'url' => '/',
'base' => '/',
'method' => $method,
'referrer' => '',
'ip' => '127.0.0.1',
'ajax' => false,
'scheme' => 'http',
'user_agent' => 'Test',
'type' => 'application/x-www-form-urlencoded',
'length' => strlen($body),
'secure' => false,
'accept' => '',
'proxy_ip' => '',
'host' => 'localhost',
'servername' => 'localhost',
'stream_path' => $stream_path,
'data' => new Collection(),
'query' => new Collection(),
'cookies' => new Collection(),
'files' => new Collection()
];
$request = new Request($config); $request = new Request($config);

Loading…
Cancel
Save