From 638c38bf010731dae5c16447aa8a4f976350a943 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Fri, 16 Dec 2022 11:43:39 +0100 Subject: [PATCH 1/2] Fix GH-10112: LDAP\Connection::__construct() refers to ldap_create() There is no `ldap_create()`, but rather `ldap_connect()`. --- ext/ldap/ldap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 6e0f28f68080e..19b6e05d4ecf1 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -119,7 +119,7 @@ static zend_object *ldap_link_create_object(zend_class_entry *class_type) { } static zend_function *ldap_link_get_constructor(zend_object *object) { - zend_throw_error(NULL, "Cannot directly construct LDAP\\Connection, use ldap_create() instead"); + zend_throw_error(NULL, "Cannot directly construct LDAP\\Connection, use ldap_connect() instead"); return NULL; } From a2796a7ba9704f287ed33d38d6924c7a8567b697 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Fri, 16 Dec 2022 12:16:38 +0100 Subject: [PATCH 2/2] Fix test expectation --- ext/ldap/tests/ldap_constructor.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ldap/tests/ldap_constructor.phpt b/ext/ldap/tests/ldap_constructor.phpt index 37db6112dcee5..6c79dee8b3982 100644 --- a/ext/ldap/tests/ldap_constructor.phpt +++ b/ext/ldap/tests/ldap_constructor.phpt @@ -11,4 +11,4 @@ try { echo "Exception: ", $ex->getMessage(), "\n"; } --EXPECT-- -Exception: Cannot directly construct LDAP\Connection, use ldap_create() instead +Exception: Cannot directly construct LDAP\Connection, use ldap_connect() instead