Merge pull request #46058 from nextcloud/fix/task-processing-input-validation

Fix task processing input validation
pull/46136/head
Marcel Klehr 5 months ago committed by GitHub
commit beececf660
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      lib/private/TaskProcessing/Manager.php

@ -489,7 +489,8 @@ class Manager implements IManager {
* @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);
}

Loading…
Cancel
Save