From 0bfdcaa005b14c1982612b219e04c9c340853972 Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Mon, 2 Dec 2024 01:25:22 +0100 Subject: [PATCH] Revert "Fix PHP 8.3 "Usage of ldap_connect with two arguments is deprecated" exception" Summary: Revert commit 700090917af6dd2e27c9fd82269797b6ec5def59 per T15963. Fixes T15963 Opens T15724 Test Plan: N/A. Reviewers: O1 Blessed Committers, valerio.bozzolan Reviewed By: O1 Blessed Committers, valerio.bozzolan Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T15963, T15724 Differential Revision: https://we.phorge.it/D25842 --- src/applications/auth/adapter/PhutilLDAPAuthAdapter.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/applications/auth/adapter/PhutilLDAPAuthAdapter.php b/src/applications/auth/adapter/PhutilLDAPAuthAdapter.php index 6b552dda53..14047c1761 100644 --- a/src/applications/auth/adapter/PhutilLDAPAuthAdapter.php +++ b/src/applications/auth/adapter/PhutilLDAPAuthAdapter.php @@ -305,12 +305,7 @@ final class PhutilLDAPAuthAdapter extends PhutilAuthAdapter { 'port' => $this->port, )); - if ($this->ldapStartTLS) { - $ldap_server_uri = 'ldaps://'.$host.':'.$this->port; - } else { - $ldap_server_uri = 'ldap://'.$host.':'.$this->port; - } - $conn = @ldap_connect($ldap_server_uri); + $conn = @ldap_connect($host, $this->port); $profiler->endServiceCall( $call_id, @@ -320,7 +315,7 @@ final class PhutilLDAPAuthAdapter extends PhutilAuthAdapter { if (!$conn) { throw new Exception( - pht('Unable to connect to LDAP server (%s).', $ldap_server_uri)); + pht('Unable to connect to LDAP server (%s:%d).', $host, $port)); } $options = array(