Check arguments to camelize() for usefulness

Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
This commit is contained in:
Pablo Zmdl 2026-01-27 10:52:20 +01:00
parent 078f3caf8a
commit ec66b359e0

View file

@ -934,6 +934,12 @@ class ConfigurationManager
}
private function camelize(string $input, string $delimiter = '_') : string {
if ($input === '') {
throw new InvalidSettingConfigurationException('input cannot be empty!');
}
if ($delimiter === '') {
$delimiter = '_';
}
return lcfirst(implode("", array_map('ucfirst', explode($delimiter, strtolower($input)))));
}