Skip to content

Commit

Permalink
LdapConnection: Access array key only if its set
Browse files Browse the repository at this point in the history
The key `$controlsReturned[LDAP_CONTROL_PAGEDRESULTS]` can be undefined
when `$controls[LDAP_CONTROL_PAGEDRESULTS]['iscritical']` is set to false.
  • Loading branch information
sukhwinder33445 authored and nilmerg committed Aug 7, 2024
1 parent f8c08db commit c27ca26
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion library/Icinga/Protocol/Ldap/LdapConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,9 @@ protected function runPagedQuery(LdapQuery $query, array $fields = null, $pageSi
}
} else {
ldap_parse_result($ds, $results, $errno, $dn, $errmsg, $refs, $controlsReturned);
$cookie = $controlsReturned[LDAP_CONTROL_PAGEDRESULTS]['value']['cookie'];
if (isset($controlsReturned[LDAP_CONTROL_PAGEDRESULTS])) {
$cookie = $controlsReturned[LDAP_CONTROL_PAGEDRESULTS]['value']['cookie'];
}
}

ldap_free_result($results);
Expand Down

0 comments on commit c27ca26

Please sign in to comment.