[php-src] PHP-8.6: Merge branch 'PHP-8.5' into PHP-8.6

From: Date: Tue, 17 Nov 2026 08:41:26 +0000
Subject: [php-src] PHP-8.6: Merge branch 'PHP-8.5' into PHP-8.6
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-143756@lists.php.net to get a copy of this message
Author: Tim Düsterhus (TimWolla) Date: 2026-11-17T09:41:14+01:00 Commit: https://github.com/php/php-src/commit/3d58679172a1fd37a440e6626b99e38bf6045d4c Raw diff: https://github.com/php/php-src/commit/3d58679172a1fd37a440e6626b99e38bf6045d4c.diff Merge branch 'PHP-8.5' into PHP-8.6 * PHP-8.5: ldap: Fix the ldap_set_option() controls type error naming the wrong option (#25502) Changed paths: A ext/ldap/tests/ldap_set_option_controls_type_error.phpt M ext/ldap/ldap.c M ext/ldap/tests/ldap_set_option_error.phpt Diff: diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index cbcd2f7c1b40..539661d52c70 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -3338,7 +3338,9 @@ PHP_FUNCTION(ldap_set_option) LDAPControl **ctrls; if (Z_TYPE_P(newval) != IS_ARRAY) { - zend_argument_type_error(3, "must be of type array for the LDAP_OPT_CLIENT_CONTROLS option, %s given", zend_zval_value_name(newval)); + zend_argument_type_error(3, "must be of type array for the %s option, %s given", + option == LDAP_OPT_SERVER_CONTROLS ? "LDAP_OPT_SERVER_CONTROLS" : "LDAP_OPT_CLIENT_CONTROLS", + zend_zval_value_name(newval)); RETURN_THROWS(); } diff --git a/ext/ldap/tests/ldap_set_option_controls_type_error.phpt b/ext/ldap/tests/ldap_set_option_controls_type_error.phpt new file mode 100644 index 000000000000..c910d8445bc5 --- /dev/null +++ b/ext/ldap/tests/ldap_set_option_controls_type_error.phpt @@ -0,0 +1,18 @@ +--TEST-- +ldap_set_option(): the type error for the controls options names the option +--EXTENSIONS-- +ldap +--FILE-- +<?php +$l = ldap_connect('ldap://127.0.0.1:1'); +foreach ([LDAP_OPT_SERVER_CONTROLS, LDAP_OPT_CLIENT_CONTROLS] as $option) { + try { + ldap_set_option($l, $option, "x"); + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } +} +?> +--EXPECT-- +TypeError: ldap_set_option(): Argument #3 ($value) must be of type array for the LDAP_OPT_SERVER_CONTROLS option, string given +TypeError: ldap_set_option(): Argument #3 ($value) must be of type array for the LDAP_OPT_CLIENT_CONTROLS option, string given diff --git a/ext/ldap/tests/ldap_set_option_error.phpt b/ext/ldap/tests/ldap_set_option_error.phpt index 92b84a2e9174..9eb1b4ff9565 100644 --- a/ext/ldap/tests/ldap_set_option_error.phpt +++ b/ext/ldap/tests/ldap_set_option_error.phpt @@ -38,4 +38,4 @@ foreach ($controls as $control) { bool(false) ValueError: ldap_set_option(): Control must have an "oid" key TypeError: ldap_set_option(): Argument #3 ($value) must contain only arrays, where each array is a control -TypeError: ldap_set_option(): Argument #3 ($value) must be of type array for the LDAP_OPT_CLIENT_CONTROLS option, string given +TypeError: ldap_set_option(): Argument #3 ($value) must be of type array for the LDAP_OPT_SERVER_CONTROLS option, string given

« previous php.cvs (#143756) next »