Skip to content

Commit 3e2e46b

Browse files
[Ldap] Fix extension deprecation
1 parent a041879 commit 3e2e46b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Tests/LdapTestCase.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ class LdapTestCase extends TestCase
1717
{
1818
protected function getLdapConfig()
1919
{
20-
$h = @ldap_connect(getenv('LDAP_HOST'), getenv('LDAP_PORT'));
20+
if (\PHP_VERSION_ID < 80300) {
21+
$h = @ldap_connect(getenv('LDAP_HOST'), getenv('LDAP_PORT'));
22+
} else {
23+
$h = @ldap_connect('ldap://'.getenv('LDAP_HOST').':'.getenv('LDAP_PORT'));
24+
}
25+
2126
@ldap_set_option($h, \LDAP_OPT_PROTOCOL_VERSION, 3);
2227

2328
if (!$h || !@ldap_bind($h)) {

0 commit comments

Comments
 (0)