mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 00:37:52 +00:00
Bugfixes
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user