@@ -800,7 +800,21 @@ function ldap_get_values($link_identifier, $result_entry_identifier, string $att
800800function 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 )
801801{
802802 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+ }
804818 if ($ result === false ) {
805819 throw LdapException::createFromPhpError ();
806820 }
@@ -1181,7 +1195,21 @@ function ldap_parse_result($link, $result, int &$errcode, string &$matcheddn = n
11811195function 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 )
11821196{
11831197 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+ }
11851213 if ($ result === false ) {
11861214 throw LdapException::createFromPhpError ();
11871215 }
@@ -1349,7 +1377,21 @@ function ldap_sasl_bind($link, string $binddn = null, string $password = null, s
13491377function 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 )
13501378{
13511379 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+ }
13531395 if ($ result === false ) {
13541396 throw LdapException::createFromPhpError ();
13551397 }
0 commit comments