Merge branch 'v4-development' of github.com:skipperbent/simple-php-router into v4-development

This commit is contained in:
Simon Sessingø
2021-03-17 20:20:56 +01:00
5 changed files with 18 additions and 9 deletions
+11 -2
View File
@@ -303,13 +303,22 @@ class InputHandler
// Append any PHP-input json
if (strpos(trim($contents), '{') === 0) {
$post = json_decode($contents, true);
if ($post !== false) {
$output += $post;
}
}
}
return (\count($filter) > 0) ? array_intersect_key($output, array_flip($filter)) : $output;
$output = (\count($filter) > 0) ? array_intersect_key($output, array_flip($filter)) : $output;
foreach ($filter as $filterKey) {
if (array_key_exists($filterKey, $output) === false) {
$output[$filterKey] = null;
}
}
return $output;
}
/**
@@ -345,4 +354,4 @@ class InputHandler
$this->file[$key] = $item;
}
}
}