Skip to content

bugfix: $controls MUST not be NULL when calling ldap_search()#4796

Closed
utesche wants to merge 1 commit intoILIAS-eLearning:trunkfrom
utesche:patch-3
Closed

bugfix: $controls MUST not be NULL when calling ldap_search()#4796
utesche wants to merge 1 commit intoILIAS-eLearning:trunkfrom
utesche:patch-3

Conversation

@utesche
Copy link
Contributor

@utesche utesche commented Jul 18, 2022

otherwise a TypeError Exception is raised:

TypeError thrown with message "ldap_search() expects parameter 9 to be array, null given"

Stacktrace:
#10 TypeError in /.../Services/LDAP/classes/class.ilLDAPQuery.php:520
#9 ldap_search in /.../Services/LDAP/classes/class.ilLDAPQuery.php:520
#8 ilLDAPQuery:queryByScope in /.../Services/LDAP/classes/class.ilLDAPQuery.php:474
#7 ilLDAPQuery:readUserData in /.../Services/LDAP/classes/class.ilLDAPQuery.php:87
#6 ilLDAPQuery:fetchUser in /.../Services/LDAP/classes/class.ilAuthProviderLDAP.php:58

otherwise a TypeError Exception is raised:

TypeError thrown with message "ldap_search() expects parameter 9 to be array, null given"

Stacktrace:
ILIAS-eLearning#10 TypeError in /.../Services/LDAP/classes/class.ilLDAPQuery.php:520
ILIAS-eLearning#9 ldap_search in /.../Services/LDAP/classes/class.ilLDAPQuery.php:520
ILIAS-eLearning#8 ilLDAPQuery:queryByScope in /.../Services/LDAP/classes/class.ilLDAPQuery.php:474
ILIAS-eLearning#7 ilLDAPQuery:readUserData in /.../Services/LDAP/classes/class.ilLDAPQuery.php:87
ILIAS-eLearning#6 ilLDAPQuery:fetchUser in /.../Services/LDAP/classes/class.ilAuthProviderLDAP.php:58
@mjansenDatabay mjansenDatabay added bugfix php Pull requests that update Php code labels Jul 18, 2022
@mjansenDatabay
Copy link
Contributor

mjansenDatabay commented Jan 9, 2023

Thx @utesche , the $controls parameter accepts null with PHP >= 8.x (https://www.php.net/manual/en/function.ldap-search.php), therefore I close this PR and pick your fix for release_8, for trunk we will use null as the default.

@mjansenDatabay
Copy link
Contributor

mjansenDatabay commented Jan 9, 2023

See: #5403

mjansenDatabay added a commit to mjansenDatabay/ILIAS that referenced this pull request Jan 9, 2023
dsstrassner pushed a commit to dsstrassner/ILIAS that referenced this pull request Jan 31, 2023
@utesche utesche deleted the patch-3 branch February 15, 2023 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants