8000 bug #58143 [Ldap] Fix extension deprecation (alexandre-daubois) · symfony/symfony@73ca0b7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 73ca0b7

Browse files
committed
bug #58143 [Ldap] Fix extension deprecation (alexandre-daubois)
This PR was merged into the 5.4 branch. Discussion ---------- [Ldap] Fix extension deprecation | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | - | License | MIT Two arguments constructor is deprecated since PHP 8.3: https://www.php.net/manual/en/function.ldap-connect.php Commits ------- 8026481 [Ldap] Fix extension deprecation
2 parents af1c1a7 + 8026481 commit 73ca0b7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Symfony/Component/Ldap/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)
0