Skip to content

Conversation

@kesselb
Copy link
Contributor

@kesselb kesselb commented Aug 13, 2025

No description provided.

Signed-off-by: Daniel Kesselberg <[email protected]>
Copy link
Member

@blizzz blizzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes are not resulting in reliable behaviour in this form (plus code style).

$usersFound=$this->ensureUser($rawUidCandidate);
if(count($usersFound) != 1)
{
throw new NoUserFoundException('User' . $rawUidCandidate . ' not valid or not found');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will work on maybe 99% of the cases, but not where the search attributes are configured in a way that would not reliably find the user.

Should not throw but continue with previous behaviour.

{
throw new NoUserFoundException('User' . $rawUidCandidate . ' not valid or not found');
}
$user = array_keys($usersFound)[0];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a risk that more records are returned and that the first one is not the correct one.

It would be acceptable to cycle through the result and compare with the uid candidate (after sanitizing), for instance.

@kesselb kesselb closed this Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants