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
parent a17f4d4eb1
commit f2a5a8d70e
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A

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;
}
}
/**