This commit is contained in:
Simon Sessingø
2016-11-28 04:20:34 +01:00
parent 74351e0330
commit d9b97ccf42
10 changed files with 74 additions and 132 deletions
+7 -7
View File
@@ -51,18 +51,17 @@ class Input
}
/* Parse get requests */
$this->file = $this->parseFiles();
if (count($_FILES) > 0) {
$this->file = $this->parseFiles();
}
}
public function parseFiles()
{
if (count($_FILES) === 0) {
return [];
}
$files = $_FILES;
$list = [];
foreach ($_FILES as $key => $value) {
foreach ($files as $key => $value) {
// Handle array input
if (is_array($value['name']) === false) {
@@ -95,7 +94,8 @@ class Input
$path = $original[$property];
foreach (array_values($index) as $i) {
$tmp = array_values($index);
foreach ($tmp as $i) {
$path = $path[$i];
}
+2 -3
View File
@@ -42,14 +42,13 @@ class InputFile implements IInputItem
'error' => null,
], $values);
$input = new static($values['index']);
$input->setError($values['error'])
return (new static($values['index']))
->setError($values['error'])
->setSize($values['size'])
->setType($values['type'])
->setTmpName($values['tmp_name'])
->setFilename($values['name']);
return $input;
}
/**