LdapConnection: Access array key only if its set

The key `$controlsReturned[LDAP_CONTROL_PAGEDRESULTS]` can be undefined
when `$controls[LDAP_CONTROL_PAGEDRESULTS]['iscritical']` is set to false.
This commit is contained in:
Sukhwinder Dhillon 2024-04-03 12:29:27 +02:00 committed by Johannes Meyer
parent f8c08dbfec
commit c27ca26dad
1 changed files with 3 additions and 1 deletions

View File

@ -1020,7 +1020,9 @@ class LdapConnection implements Selectable, Inspectable
}
} 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);