Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c3cd264

Browse files
committed
Improve error reporting during LDAP bind
Based on the https://www.php.net/manual/en/function.ldap-error.php#121881
1 parent 5028ec6 commit c3cd264

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/Symfony/Component/Ldap/Adapter/ExtLdap/Connection.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ public function bind(?string $dn = null, #[\SensitiveParameter] ?string $passwor
7878
case self::LDAP_ALREADY_EXISTS:
7979
throw new AlreadyExistsException($error);
8080
}
81-
throw new ConnectionException($error);
81+
ldap_get_option($this->connection, LDAP_OPT_DIAGNOSTIC_MESSAGE, $diagnostic_message);
82+
throw new ConnectionException($error . ' ' . $diagnostic_message);
8283
}
8384

8485
$this->bound = true;

src/Symfony/Component/Ldap/CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
7.1
5+
---
6+
7+
* Improve error reporting during LDAP bind
8+
49
7.0
510
---
611

0 commit comments

Comments
 (0)