Skip to content

Commit

Permalink
Merge pull request #46058 from nextcloud/fix/task-processing-input-va…
Browse files Browse the repository at this point in the history
…lidation

Fix task processing input validation
  • Loading branch information
marcelklehr authored Jul 1, 2024
2 parents 3b75c5b + 42cf03d commit beececf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/private/TaskProcessing/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,8 @@ private function validateOutput(array $spec, array $io, bool $optional = false):
* @psalm-template T
*/
private function removeSuperfluousArrayKeys(array $array, ...$specs): array {
$keys = array_unique(array_reduce($specs, fn ($carry, $spec) => $carry + array_keys($spec), []));
$keys = array_unique(array_reduce($specs, fn ($carry, $spec) => array_merge($carry, array_keys($spec)), []));
$keys = array_filter($keys, fn ($key) => array_key_exists($key, $array));
$values = array_map(fn (string $key) => $array[$key], $keys);
return array_combine($keys, $values);
}
Expand Down

0 comments on commit beececf

Please sign in to comment.