feat(recent-files): handle invalid config when only min or max are set for recent files limit

Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
pull/58761/head
Cristian Scheid 2 months ago
parent 282e6b707a
commit 981978d960
  1. 2
      apps/files/lib/Service/UserConfig.php

@ -159,6 +159,8 @@ class UserConfig {
if ((int)$value < $config['min'] || (int)$value > $config['max']) {
throw new \InvalidArgumentException('Invalid config value');
}
} elseif (isset($config['min']) || isset($config['max'])) {
throw new \InvalidArgumentException('Invalid config definition: min and max must both be defined');
} elseif (!in_array($value, $this->getAllowedConfigValues($key))) {
throw new \InvalidArgumentException('Invalid config value');
}

Loading…
Cancel
Save