mirror of
https://github.com/nextcloud/server.git
synced 2026-04-21 14:23:17 -04:00
Merge pull request #37197 from nextcloud/fix/user_ldap-do-not-send-0-size-pagination-control
Do not send a pagination control with size = 0 if cookie is empty
This commit is contained in:
commit
95eefd38eb
1 changed files with 13 additions and 9 deletions
|
|
@ -190,14 +190,18 @@ class LDAP implements ILDAPWrapper {
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
public function search($link, $baseDN, $filter, $attr, $attrsOnly = 0, $limit = 0, int $pageSize = 0, string $cookie = '') {
|
||||
$serverControls = [[
|
||||
'oid' => LDAP_CONTROL_PAGEDRESULTS,
|
||||
'value' => [
|
||||
'size' => $pageSize,
|
||||
'cookie' => $cookie,
|
||||
],
|
||||
'iscritical' => false,
|
||||
]];
|
||||
if ($pageSize > 0 || $cookie !== '') {
|
||||
$serverControls = [[
|
||||
'oid' => LDAP_CONTROL_PAGEDRESULTS,
|
||||
'value' => [
|
||||
'size' => $pageSize,
|
||||
'cookie' => $cookie,
|
||||
],
|
||||
'iscritical' => false,
|
||||
]];
|
||||
} else {
|
||||
$serverControls = [];
|
||||
}
|
||||
|
||||
$oldHandler = set_error_handler(function ($no, $message, $file, $line) use (&$oldHandler) {
|
||||
if (strpos($message, 'Partial search results returned: Sizelimit exceeded') !== false) {
|
||||
|
|
@ -387,7 +391,7 @@ class LDAP implements ILDAPWrapper {
|
|||
if ($this->isResource($this->curArgs[0])) {
|
||||
$resource = $this->curArgs[0];
|
||||
} elseif (
|
||||
$functionName === 'ldap_search'
|
||||
$functionName === 'ldap_search'
|
||||
&& is_array($this->curArgs[0])
|
||||
&& $this->isResource($this->curArgs[0][0])
|
||||
) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue