From b8ac2071b897481938c6207989654cc3132ff317 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Fri, 16 Dec 2022 12:16:38 +0100 Subject: [PATCH] Fix GH-10112: LDAP\Connection::__construct() refers to ldap_create() There is no `ldap_create()`, but rather `ldap_connect()`. Closes GH-10115. --- NEWS | 4 ++++ ext/ldap/ldap.c | 2 +- ext/ldap/tests/ldap_constructor.phpt | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 9994834a7f5..6d165ca1a70 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,10 @@ PHP NEWS - Apache: . Fixed bug GH-9949 (Partial content on incomplete POST request). (cmb) +- LDAP: + . Fixed bug GH-10112 (LDAP\Connection::__construct() refers to ldap_create()). + (cmb) + - TSRM: . Fixed Windows shmget() wrt. IPC_PRIVATE. (Tyson Andre) diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 6e0f28f6808..19b6e05d4ec 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; } diff --git a/ext/ldap/tests/ldap_constructor.phpt b/ext/ldap/tests/ldap_constructor.phpt index 37db6112dce..6c79dee8b39 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