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 Andy Scherzinger
parent abb135e64d
commit 8caeb11991

View file

@ -163,9 +163,14 @@ class Manager {
* @return bool
*/
public function isDeletedUser($id) {
$isDeleted = $this->ocConfig->getUserValue(
$id, 'user_ldap', 'isDeleted', 0);
return (int)$isDeleted === 1;
try {
$isDeleted = $this->ocConfig->getUserValue($id, 'user_ldap', 'isDeleted', 0);
return (int)$isDeleted === 1;
} 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;
}
}
/**