Skip to content

Commit da3798f

Browse files
committed
RequestFactory: improved checking of $_FILES structure
1 parent 36148c1 commit da3798f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Http/RequestFactory.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ public function createHttpRequest()
135135
$list = [];
136136
if (!empty($_FILES)) {
137137
foreach ($_FILES as $k => $v) {
138-
if (!$this->binary && is_string($k) && (!preg_match($reChars, $k) || preg_last_error())) {
138+
if (!is_array($v) || !isset($v['name'], $v['type'], $v['size'], $v['tmp_name'], $v['error'])
139+
|| (!$this->binary && is_string($k) && (!preg_match($reChars, $k) || preg_last_error()))
140+
) {
139141
continue;
140142
}
141143
$v['@'] = & $files[$k];

0 commit comments

Comments
 (0)