Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add isset check on $entries[$i]["description"] #53

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

julianfresco
Copy link

I was using your library (it's a great tool BTW) and came across this exception while using the $adLDAP->groups()->all() method.

exception 'ErrorException' with message 'Undefined index: description'

To fix this error, I added a conditional to the if clause that was searching for data in $entries[$i]["description"]. I figured I might pass this on in case it is helpful to others.

@samwilson
Copy link
Contributor

Would empty() work just as well here (and be a bit shorter)?

if ($includeDescription && !empty($entries[$i]["description"][0])) {
    ...
}

@julianfresco
Copy link
Author

Yes, that worked just fine in my implementation. Thanks for the suggestion.

Do I need to resubmit the pull request? (Sorry-this is my first one)

@samwilson
Copy link
Contributor

Do I need to resubmit the pull request? (Sorry-this is my first one)

Nope, anything you push to that branch will be part of the PR. :-)

@samwilson
Copy link
Contributor

Can this be merged?

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