sergix44/XBackBone

LDAP login broken with php8.1+

nebulade opened this issue · 1 comments

While testing a package update for Cloudron for XBackBone 3.6.2, our tests found ldap login broken.

Since php 8.1 changed the result of ldap_search() from a resource to a specific class ( https://www.php.net/manual/en/class.ldap-result.php ) the login fails.

This is caused by the is_resource check at https://github.com/SergiX44/XBackBone/blob/master/app/Controllers/Auth/AuthController.php#L97 which now always fails. I am not sure what the implications for this are for php 7 but changing that to:

if (!$ldapSearchResp) {

fixes the issue for php 8.1+

I could also create a PR for this if wanted, but I guess we first have to get a better picture on how to check for the result in both php7 and php8.

Given that PHP 7.4 is deprecated/EOL, it's probably not needed to support it.