|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74023 ldap_control_paged_result cannot be undone
Submitted: 2017-01-31 15:00 UTC Modified: 2017-09-27 15:27 UTC
From: markusu49 at aol dot com Assigned: mcmic (profile)
Status: Closed Package: LDAP related
PHP Version: 7.1.1 OS: linux (Ubuntu Server 16.04.1)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: markusu49 at aol dot com
New email:
PHP Version: OS:


 [2017-01-31 15:00 UTC] markusu49 at aol dot com
It's not possible to reset ldap_control_paged_result. Should work with a pagesize of 0. See here:

"A sequence of paged search requests is abandoned by the client sending a search request containing a pagedResultsControl with the size set to zero (0) and the cookie set to the last cookie returned by the server."

The comments in the docs point this out, too:

LDAP servers behave differently, OpenLDAP even reacts with a segfault.

Test script:

Expected result:
ldap_search returns all entries (eventually limited by server)

Actual result:
ldap_search returns 0 entries with AD, OpenLDAP segfaults


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-31 15:56 UTC] markusu49 at aol dot com
I created a working java example to show that it's no server side issue:
 [2017-07-26 10:03 UTC]
Note that starting from PHP 7.2, as a work-around you can use:
ldap_set_option(ldap, LDAP_OPT_SERVER_CONTROLS, array());

As a work-around to stop pagination.
But please note that this will remove all controls if some other were also set (but this seems unlikely as PHP has little way of adding controls in current releases)
You may use ldap_get_option and check the oid of the controls before removing them.

In future PHP versions proper support for controls will be added and paged result should be easier to manage.
 [2017-09-27 15:27 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: mcmic
 [2017-09-27 15:27 UTC]
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

This is fixed in 7.3 if you use the new way of joining controls to an ldap search.

I think ldap_control_paged_result will get deprecated at some point.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jul 13 22:01:29 2024 UTC