Skip to content

Commit beececf

Browse files
authored
Merge pull request #46058 from nextcloud/fix/task-processing-input-validation
Fix task processing input validation
2 parents 3b75c5b + 42cf03d commit beececf

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/private/TaskProcessing/Manager.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,8 @@ private function validateOutput(array $spec, array $io, bool $optional = false):
489489
* @psalm-template T
490490
*/
491491
private function removeSuperfluousArrayKeys(array $array, ...$specs): array {
492-
$keys = array_unique(array_reduce($specs, fn ($carry, $spec) => $carry + array_keys($spec), []));
492+
$keys = array_unique(array_reduce($specs, fn ($carry, $spec) => array_merge($carry, array_keys($spec)), []));
493+
$keys = array_filter($keys, fn ($key) => array_key_exists($key, $array));
493494
$values = array_map(fn (string $key) => $array[$key], $keys);
494495
return array_combine($keys, $values);
495496
}

0 commit comments

Comments
 (0)