LdapUtility::getFirstEntry() lacks error handling
masi opened this issue · comments
Martin Kutschker commented
$attributes = @ldap_get_attributes($this->connection, $this->firstResultEntry);
may return FALSE on array. In this case the following foreach
loop will trigger a warning/error.
In the flow of the code it may be the case that $this->firstResultEntry
is FALSE. In other other parts of the code there is some protection: is_resource($this->firstResultEntry)
.
Sidenote: It is not clear to me why $this->status['get_first_entry']['status'] = ldap_error($this->connection);
is executed as the very first statement in the function.