Skip to content

fix(ldap): Avoid calling ldap_filter with an empty filter - #64027

Open
CarlSchwan wants to merge 1 commit into
masterfrom
carl/empty-ldap-filter
Open

fix(ldap): Avoid calling ldap_filter with an empty filter#64027
CarlSchwan wants to merge 1 commit into
masterfrom
carl/empty-ldap-filter

Conversation

@CarlSchwan

Copy link
Copy Markdown
Member
  • Resolves: #

Summary

TODO

  • ...

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
@CarlSchwan
CarlSchwan requested a review from a team as a code owner September 4, 2026 15:19
@CarlSchwan
CarlSchwan requested review from Altahrim, come-nc, provokateurin and sorbaugh and removed request for a team September 4, 2026 15:19

// an empty filter is invalid and causes ldap_search() to fail, so
// fall back to matching any object
if (empty($this->configuration->ldapUserFilter)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Did you try it?

I remember empty() does not work against virtual attributes from magic getters. See https://www.php.net/manual/en/function.empty.php#refsect1-function.empty-notes

Either fetch the value first, or implement __isset() in Configuration.

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.

2 participants