sergix44 / XBackBone

A lightweight file manager with full ShareX support and more
https://xbackbone.app
GNU Affero General Public License v3.0
993 stars 81 forks source link

LDAP login broken with php8.1+ #531

Closed nebulade closed 1 year ago

nebulade commented 1 year ago

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.

gramakri commented 1 year ago

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