Skip to content

Commit

Permalink
Fix params handler not returning expected array
Browse files Browse the repository at this point in the history
Most (if not all) usage of it already assumes the function returns array
with specified keys when `null_missing` is enabled.
  • Loading branch information
nanaya committed Sep 28, 2024
1 parent dcfce28 commit 7c73b1c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -1605,9 +1605,13 @@ function get_params($input, $namespace, $keys, $options = [])

$params = [];

if (Arr::accessible($input)) {
$options['null_missing'] = $options['null_missing'] ?? false;
$options['null_missing'] ??= false;

if (!Arr::accessible($input) && $options['null_missing']) {
$input = [];
}

if (Arr::accessible($input)) {
foreach ($keys as $keyAndType) {
$keyAndType = explode(':', $keyAndType);

Expand Down

0 comments on commit 7c73b1c

Please sign in to comment.