mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
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>
This commit is contained in:
parent
229a3bbf0a
commit
f5df0a132f
1 changed files with 2 additions and 0 deletions
|
|
@ -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…
Reference in a new issue