From 8026481f182db7445d0c07ce48b63e477cf7892e Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Mon, 2 Sep 2024 10:05:21 +0200 Subject: [PATCH] [Ldap] Fix extension deprecation --- src/Symfony/Component/Ldap/Tests/LdapTestCase.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Ldap/Tests/LdapTestCase.php b/src/Symfony/Component/Ldap/Tests/LdapTestCase.php index 45605cd4c4891..39b9184c64c83 100644 --- a/src/Symfony/Component/Ldap/Tests/LdapTestCase.php +++ b/src/Symfony/Component/Ldap/Tests/LdapTestCase.php @@ -17,7 +17,12 @@ class LdapTestCase extends TestCase { protected function getLdapConfig() { - $h = @ldap_connect(getenv('LDAP_HOST'), getenv('LDAP_PORT')); + if (\PHP_VERSION_ID < 80300) { + $h = @ldap_connect(getenv('LDAP_HOST'), getenv('LDAP_PORT')); + } else { + $h = @ldap_connect('ldap://'.getenv('LDAP_HOST').':'.getenv('LDAP_PORT')); + } + @ldap_set_option($h, \LDAP_OPT_PROTOCOL_VERSION, 3); if (!$h || !@ldap_bind($h)) {