Ignore $supported_extensions when it's empty #230
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a LDAP Authentication Plugin on PHP8 + SAMBA4 AD simple fix.
Symptoms:
PHP Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, string given in /var/www/osticket/web.1.16.git/include/plugins/auth-ldap/include/Net/LDAP2.php:640
Stack trace:
#0 /var/www/osticket/web.1.16.git/include/plugins/auth-ldap/include/Net/LDAP2.php(640): in_array()
#1 /var/www/osticket/web.1.16.git/include/plugins/auth-ldap/include/Net/LDAP2.php(444): Net_LDAP2->startTLS()
#2 /var/www/osticket/web.1.16.git/include/plugins/auth-ldap/include/Net/LDAP2.php(339): Net_LDAP2->performConnect()
#3 /var/www/osticket/web.1.16.git/include/plugins/auth-ldap/authentication.php(158): Net_LDAP2->bind()
#4 /var/www/osticket/web.1.16.git/include/plugins/auth-ldap/authentication.php(191): LDAPAuthentication->getConnection()
#5 /var/www/osticket/web.1.16.git/include/plugins/auth-ldap/authentication.php(479): LDAPAuthentication->authenticate()
#6 /var/www/osticket/web.1.16.git/include/class.auth.php(249): ClientLDAPAuthentication->authenticate()
#7 /var/www/osticket/web.1.16.git/login.php(51): AuthenticationBackend::process()
During "auth-ldap" initialization startTLS() tries to get "supportedExtensions" from rootDSE.
SAMBA AD LDAP has "supportedCapabilities" and "supportedControl" entries but no "supportedExtensions".
$rootDSE->getValue('supportedExtension') return an empty string (could it be better to return an empty array ?)
PHP 5.x and PHP 7.x give warnings
PHP 8 (osTicket 1.16 requirement) gives fatal error.