Skip to content

Commit eb70263

Browse files
heiglandreasCôme Bernigaud
authored andcommitted
Implements extended error messages
This commit introduces a new constant that can be used to retrieve more detailed error messages. This fixes #47222 The new constant LDAP_OPT_DIAGNOSTIC_MESSAGE is defined in PHP when the underlying library provides (and understands) it. This is the case in the current OpenLDAP-implementation. Tanks to Johnny Willer who provided the solution at http://stackoverflow.com/questions/28765077/get-number-of-ad-errors-with-ldap-and-php-ldap-function-return-unprecise-error/28816473#28816473
1 parent e7af0fe commit eb70263

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ext/ldap/ldap.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,10 @@ PHP_MINIT_FUNCTION(ldap)
202202
REGISTER_LONG_CONSTANT("LDAP_OPT_DEBUG_LEVEL", LDAP_OPT_DEBUG_LEVEL, CONST_PERSISTENT | CONST_CS);
203203
#endif
204204

205+
#ifdef LDAP_OPT_DIAGNOSTIC_MESSAGE
206+
REGISTER_LONG_CONSTANT("LDAP_OPT_DIAGNOSTIC_MESSAGE", LDAP_OPT_DIAGNOSTIC_MESSAGE, CONST_PERSISTENT | CONST_CS);
207+
#endif
208+
205209
#ifdef HAVE_LDAP_SASL
206210
REGISTER_LONG_CONSTANT("LDAP_OPT_X_SASL_MECH", LDAP_OPT_X_SASL_MECH, CONST_PERSISTENT | CONST_CS);
207211
REGISTER_LONG_CONSTANT("LDAP_OPT_X_SASL_REALM", LDAP_OPT_X_SASL_REALM, CONST_PERSISTENT | CONST_CS);

0 commit comments

Comments
 (0)