heiglandreas / authLdap

LDAP-Authentication for WordPress
http://andreas.heigl.org/cat/dev/wp/authldap/
MIT License
69 stars 38 forks source link

Adapt to PHP8.1 #212

Closed heiglandreas closed 2 years ago

heiglandreas commented 2 years ago

In PHP 8.1 the ldap-functions no longer return ressources but classes. That is no issue within the API but becomes an issue when checking whether something is a resource as that suddenly will not be one anymore.

This commit replaces the checks for a ressource with the check whether the property is NULL or not.

Fixes #211

PLUS-RobertEhrenleitner commented 2 years ago

That's a good catch. Our website still runs on 7.4, that's why I didn't notice this. You can still check if the ldap_* functions do not return false; and do not use type checking when passing the resource resp. object as formal parameter to a function.