fix(user_ldap): Fix crash in some code path when a DN is longer that 64

UserConfig throws in this case.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2026-01-27 14:05:53 +01:00 committed by backportbot[bot]
parent 2bc3af8b2a
commit 0e79f6e735

View file

@ -166,8 +166,13 @@ class Manager {
* @param string $id the Nextcloud username
*/
public function isDeletedUser(string $id): bool {
return $this->userConfig->getValueBool(
$id, 'user_ldap', 'isDeleted');
try {
return $this->userConfig->getValueBool($id, 'user_ldap', 'isDeleted');
} catch (\InvalidArgumentException $e) {
// Most likely the string is too long to be a valid user id
$this->logger->debug('Invalid id given to isDeletedUser', ['exception' => $e]);
return false;
}
}
/**