Skip to content
This repository was archived by the owner on Aug 24, 2021. It is now read-only.

Commit f0ddc93

Browse files
author
Côme Chilliet
committed
Removed ldap_sort and LDAP_DEPRECATED build flag
ldap_sort was deprecated in PHP7, it is now removed. This allows removing the LDAP_DEPRECATED flag when building against openldap.
1 parent 53ce98c commit f0ddc93

File tree

8 files changed

+7
-489
lines changed

8 files changed

+7
-489
lines changed

NEWS

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ PHP NEWS
1212
- Intl:
1313
. Removed deprecated INTL_IDNA_VARIANT_2003. (cmb)
1414

15+
- LDAP:
16+
. Removed deprecated ldap_sort. (mcmic)
17+
1518
- phpdbg:
1619
. Fixed bug #76596 (phpdbg support for display_errors=stderr). (kabel)
1720

UPGRADING

+3
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ PHP 8.0 UPGRADE NOTES
6868
RFC: https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003
6969
. The deprecated Normalizer::NONE constant has been removed.
7070

71+
- LDAP:
72+
. The deprecated function ldap_sort has been removed.
73+
7174
- Mbstring:
7275
. The mbstring.func_overload directive has been removed. The related
7376
MB_OVERLOAD_MAIL, MB_OVERLOAD_STRING, and MB_OVERLOAD_REGEX constants have

ext/ldap/config.m4

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ PHP_ARG_WITH(ldap-sasl,for LDAP Cyrus SASL support,
9090

9191
if test "$PHP_LDAP" != "no"; then
9292

93-
PHP_NEW_EXTENSION(ldap, ldap.c, $ext_shared,,-DLDAP_DEPRECATED=1)
93+
PHP_NEW_EXTENSION(ldap, ldap.c, $ext_shared,,)
9494

9595
if test "$PHP_LDAP" = "yes"; then
9696
for i in /usr/local /usr; do

ext/ldap/config.w32

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ if (PHP_LDAP != "no") {
1818
AC_DEFINE('HAVE_LDAP', 1);
1919
AC_DEFINE('HAVE_LDAP_SASL', 1);
2020
AC_DEFINE('HAVE_LDAP_SASL_SASL_H', 1);
21-
AC_DEFINE('LDAP_DEPRECATED', 1);
2221
AC_DEFINE('HAVE_LDAP_CONTROL_FIND', 1);
2322
AC_DEFINE('HAVE_LDAP_PARSE_EXTENDED_RESULT', 1);
2423
AC_DEFINE('HAVE_LDAP_EXTENDED_OPERATION_S', 1);

ext/ldap/ldap.c

-40
Original file line numberDiff line numberDiff line change
@@ -2937,39 +2937,6 @@ PHP_FUNCTION(ldap_compare)
29372937
}
29382938
/* }}} */
29392939

2940-
/* {{{ proto bool ldap_sort(resource link, resource result, string sortfilter)
2941-
Sort LDAP result entries */
2942-
PHP_FUNCTION(ldap_sort)
2943-
{
2944-
zval *link, *result;
2945-
ldap_linkdata *ld;
2946-
char *sortfilter;
2947-
size_t sflen;
2948-
zend_resource *le;
2949-
2950-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrs", &link, &result, &sortfilter, &sflen) != SUCCESS) {
2951-
RETURN_FALSE;
2952-
}
2953-
2954-
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
2955-
RETURN_FALSE;
2956-
}
2957-
2958-
le = Z_RES_P(result);
2959-
if (le->type != le_result) {
2960-
php_error_docref(NULL, E_WARNING, "Supplied resource is not a valid ldap result resource");
2961-
RETURN_FALSE;
2962-
}
2963-
2964-
if (ldap_sort_entries(ld->link, (LDAPMessage **) &le->ptr, sflen ? sortfilter : NULL, strcmp) != LDAP_SUCCESS) {
2965-
php_error_docref(NULL, E_WARNING, "%s", ldap_err2string(errno));
2966-
RETURN_FALSE;
2967-
}
2968-
2969-
RETURN_TRUE;
2970-
}
2971-
/* }}} */
2972-
29732940
#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP
29742941
/* {{{ proto bool ldap_get_option(resource link, int option, mixed retval)
29752942
Get the current value of various session-wide parameters */
@@ -4613,12 +4580,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_compare, 0, 0, 4)
46134580
ZEND_ARG_INFO(0, servercontrols)
46144581
ZEND_END_ARG_INFO()
46154582

4616-
ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_sort, 0, 0, 3)
4617-
ZEND_ARG_INFO(0, link)
4618-
ZEND_ARG_INFO(0, result)
4619-
ZEND_ARG_INFO(0, sortfilter)
4620-
ZEND_END_ARG_INFO()
4621-
46224583
#ifdef LDAP_CONTROL_PAGEDRESULTS
46234584
ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_control_paged_result, 0, 0, 2)
46244585
ZEND_ARG_INFO(0, link)
@@ -4817,7 +4778,6 @@ static const zend_function_entry ldap_functions[] = {
48174778
PHP_FE(ldap_err2str, arginfo_ldap_err2str)
48184779
PHP_FE(ldap_error, arginfo_ldap_resource)
48194780
PHP_FE(ldap_compare, arginfo_ldap_compare)
4820-
PHP_DEP_FE(ldap_sort, arginfo_ldap_sort)
48214781

48224782
#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP
48234783
PHP_FE(ldap_rename, arginfo_ldap_rename)

ext/ldap/tests/ldap_sort_basic.phpt

-201
This file was deleted.

ext/ldap/tests/ldap_sort_error.phpt

-45
This file was deleted.

0 commit comments

Comments
 (0)