@@ -800,7 +800,21 @@ function ldap_get_values($link_identifier, $result_entry_identifier, string $att
800
800
function ldap_list ($ link_identifier , string $ base_dn , string $ filter , array $ attributes = null , int $ attrsonly = 0 , int $ sizelimit = -1 , int $ timelimit = -1 , int $ deref = LDAP_DEREF_NEVER , array $ serverctrls = null )
801
801
{
802
802
error_clear_last ();
803
- $ result = \ldap_list ($ link_identifier , $ base_dn , $ filter , $ attributes , $ attrsonly , $ sizelimit , $ timelimit , $ deref , $ serverctrls );
803
+ if ($ serverctrls !== null ) {
804
+ $ result = \ldap_list ($ link_identifier , $ base_dn , $ filter , $ attributes , $ attrsonly , $ sizelimit , $ timelimit , $ deref , $ serverctrls );
805
+ } elseif ($ deref !== LDAP_DEREF_NEVER ) {
806
+ $ result = \ldap_list ($ link_identifier , $ base_dn , $ filter , $ attributes , $ attrsonly , $ sizelimit , $ timelimit , $ deref );
807
+ } elseif ($ timelimit !== -1 ) {
808
+ $ result = \ldap_list ($ link_identifier , $ base_dn , $ filter , $ attributes , $ attrsonly , $ sizelimit , $ timelimit );
809
+ } elseif ($ sizelimit !== -1 ) {
810
+ $ result = \ldap_list ($ link_identifier , $ base_dn , $ filter , $ attributes , $ attrsonly , $ sizelimit );
811
+ } elseif ($ attrsonly !== 0 ) {
812
+ $ result = \ldap_list ($ link_identifier , $ base_dn , $ filter , $ attributes , $ attrsonly );
813
+ } elseif ($ attributes !== null ) {
814
+ $ result = \ldap_list ($ link_identifier , $ base_dn , $ filter , $ attributes );
815
+ } else {
816
+ $ result = \ldap_list ($ link_identifier , $ base_dn , $ filter );
817
+ }
804
818
if ($ result === false ) {
805
819
throw LdapException::createFromPhpError ();
806
820
}
@@ -1181,7 +1195,21 @@ function ldap_parse_result($link, $result, int &$errcode, string &$matcheddn = n
1181
1195
function ldap_read ($ link_identifier , string $ base_dn , string $ filter , array $ attributes = null , int $ attrsonly = 0 , int $ sizelimit = -1 , int $ timelimit = -1 , int $ deref = LDAP_DEREF_NEVER , array $ serverctrls = null )
1182
1196
{
1183
1197
error_clear_last ();
1184
- $ result = \ldap_read ($ link_identifier , $ base_dn , $ filter , $ attributes , $ attrsonly , $ sizelimit , $ timelimit , $ deref , $ serverctrls );
1198
+ if ($ serverctrls !== null ) {
1199
+ $ result = \ldap_read ($ link_identifier , $ base_dn , $ filter , $ attributes , $ attrsonly , $ sizelimit , $ timelimit , $ deref , $ serverctrls );
1200
+ } elseif ($ deref !== LDAP_DEREF_NEVER ) {
1201
+ $ result = \ldap_read ($ link_identifier , $ base_dn , $ filter , $ attributes , $ attrsonly , $ sizelimit , $ timelimit , $ deref );
1202
+ } elseif ($ timelimit !== -1 ) {
1203
+ $ result = \ldap_read ($ link_identifier , $ base_dn , $ filter , $ attributes , $ attrsonly , $ sizelimit , $ timelimit );
1204
+ } elseif ($ sizelimit !== -1 ) {
1205
+ $ result = \ldap_read ($ link_identifier , $ base_dn , $ filter , $ attributes , $ attrsonly , $ sizelimit );
1206
+ } elseif ($ attrsonly !== 0 ) {
1207
+ $ result = \ldap_read ($ link_identifier , $ base_dn , $ filter , $ attributes , $ attrsonly );
1208
+ } elseif ($ attributes !== null ) {
1209
+ $ result = \ldap_read ($ link_identifier , $ base_dn , $ filter , $ attributes );
1210
+ } else {
1211
+ $ result = \ldap_read ($ link_identifier , $ base_dn , $ filter );
1212
+ }
1185
1213
if ($ result === false ) {
1186
1214
throw LdapException::createFromPhpError ();
1187
1215
}
@@ -1349,7 +1377,21 @@ function ldap_sasl_bind($link, string $binddn = null, string $password = null, s
1349
1377
function ldap_search ($ link_identifier , string $ base_dn , string $ filter , array $ attributes = null , int $ attrsonly = 0 , int $ sizelimit = -1 , int $ timelimit = -1 , int $ deref = LDAP_DEREF_NEVER , array $ serverctrls = null )
1350
1378
{
1351
1379
error_clear_last ();
1352
- $ result = \ldap_search ($ link_identifier , $ base_dn , $ filter , $ attributes , $ attrsonly , $ sizelimit , $ timelimit , $ deref , $ serverctrls );
1380
+ if ($ serverctrls !== null ) {
1381
+ $ result = \ldap_search ($ link_identifier , $ base_dn , $ filter , $ attributes , $ attrsonly , $ sizelimit , $ timelimit , $ deref , $ serverctrls );
1382
+ } elseif ($ deref !== LDAP_DEREF_NEVER ) {
1383
+ $ result = \ldap_search ($ link_identifier , $ base_dn , $ filter , $ attributes , $ attrsonly , $ sizelimit , $ timelimit , $ deref );
1384
+ } elseif ($ timelimit !== -1 ) {
1385
+ $ result = \ldap_search ($ link_identifier , $ base_dn , $ filter , $ attributes , $ attrsonly , $ sizelimit , $ timelimit );
1386
+ } elseif ($ sizelimit !== -1 ) {
1387
+ $ result = \ldap_search ($ link_identifier , $ base_dn , $ filter , $ attributes , $ attrsonly , $ sizelimit );
1388
+ } elseif ($ attrsonly !== 0 ) {
1389
+ $ result = \ldap_search ($ link_identifier , $ base_dn , $ filter , $ attributes , $ attrsonly );
1390
+ } elseif ($ attributes !== null ) {
1391
+ $ result = \ldap_search ($ link_identifier , $ base_dn , $ filter , $ attributes );
1392
+ } else {
1393
+ $ result = \ldap_search ($ link_identifier , $ base_dn , $ filter );
1394
+ }
1353
1395
if ($ result === false ) {
1354
1396
throw LdapException::createFromPhpError ();
1355
1397
}
0 commit comments