From 981978d960d02485b8668242dd69cf876d176191 Mon Sep 17 00:00:00 2001 From: Cristian Scheid Date: Mon, 23 Mar 2026 10:55:21 -0300 Subject: [PATCH] feat(recent-files): handle invalid config when only min or max are set for recent files limit Signed-off-by: Cristian Scheid --- apps/files/lib/Service/UserConfig.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/files/lib/Service/UserConfig.php b/apps/files/lib/Service/UserConfig.php index f2ad1db02d7..372b1c81595 100644 --- a/apps/files/lib/Service/UserConfig.php +++ b/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'); }