[php-src] PHP-8.6: [`%pS` migration] Use `%pS` in ext/ldap (#23156)
| From: | Daniel Scherzer via GitHub | Date: | Sat, 21 Nov 2026 23:23:12 +0000 |
| Subject: | [php-src] PHP-8.6: [`%pS` migration] Use `%pS` in ext/ldap (#23156) | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-144012@lists.php.net to get a copy of this message | ||
Author: Daniel Scherzer (DanielEScherzer)
Committer: GitHub (web-flow)
Pusher: DanielEScherzer
Date: 2026-11-21T15:23:09-08:00
Commit: https://github.com/php/php-src/commit/44c145bd581c24e1ae21b14a62d09994c8c8d892
Raw diff: https://github.com/php/php-src/commit/44c145bd581c24e1ae21b14a62d09994c8c8d892.diff
[
%pS migration] Use %pS in ext/ldap (#23156)
Changed paths:
M ext/ldap/ldap.c
Diff:
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c
index 5dad49f6ef17..f53a74010a33 100644
--- a/ext/ldap/ldap.c
+++ b/ext/ldap/ldap.c
@@ -514,7 +514,7 @@ static int php_ldap_control_from_array(LDAP *ld, LDAPControl** ctrl, const HashT
}
if (ldap_put_vrFilter(ber, ZSTR_VAL(tmpstring)) == -1) {
rc = -1;
- php_error_docref(NULL, E_WARNING, "Failed to create control value: Bad
ValuesReturnFilter: %s", ZSTR_VAL(tmpstring));
+ php_error_docref(NULL, E_WARNING, "Failed to create control value: Bad
ValuesReturnFilter: %pS", tmpstring);
} else if (ber_flatten2(ber, &control_value, control_value_alloc) == -1) {
rc = -1;
}
@@ -700,7 +700,7 @@ static int php_ldap_control_from_array(LDAP *ld, LDAPControl** ctrl, const HashT
zend_string_release_ex(context_str, false);
}
} else {
- zend_type_error("%s(): Control OID %s cannot be of type array",
get_active_function_name(), ZSTR_VAL(control_oid));
+ zend_type_error("%s(): Control OID %pS cannot be of type array",
get_active_function_name(), control_oid);
rc = -1;
}
}
@@ -2339,7 +2339,7 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper, bool
ext)
uint32_t num_values = zend_hash_num_elements(Z_ARRVAL_P(attribute_values));
if (num_values == 0) {
if (UNEXPECTED(oper == LDAP_MOD_ADD)) {
- zend_argument_value_error(3, "attribute \"%s\" must be a non-empty list of
attribute values", ZSTR_VAL(attribute));
+ zend_argument_value_error(3, "attribute \"%pS\" must be a non-empty list of
attribute values", attribute);
RETVAL_FALSE;
goto cleanup;
}
@@ -2348,7 +2348,7 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper, bool
ext)
continue;
}
if (!php_ldap_is_numerically_indexed_array(Z_ARRVAL_P(attribute_values))) {
- zend_argument_value_error(3, "attribute \"%s\" must be an array of attribute
values with numeric keys", ZSTR_VAL(attribute));
+ zend_argument_value_error(3, "attribute \"%pS\" must be an array of attribute
values with numeric keys", attribute);
RETVAL_FALSE;
goto cleanup;
}
@@ -4087,7 +4087,7 @@ static void php_ldap_exop(INTERNAL_FUNCTION_PARAMETERS, bool force_sync) {
retoid ? &lretoid : NULL,
&lretdata );
if (rc != LDAP_SUCCESS ) {
- php_error_docref(NULL, E_WARNING, "Extended operation %s failed: %s (%d)",
ZSTR_VAL(reqoid), ldap_err2string(rc), rc);
+ php_error_docref(NULL, E_WARNING, "Extended operation %pS failed: %s (%d)", reqoid,
ldap_err2string(rc), rc);
RETVAL_FALSE;
goto cleanup;
}
@@ -4122,14 +4122,14 @@ static void php_ldap_exop(INTERNAL_FUNCTION_PARAMETERS, bool force_sync) {
NULL,
&msgid);
if (rc != LDAP_SUCCESS ) {
- php_error_docref(NULL, E_WARNING, "Extended operation %s failed: %s (%d)",
ZSTR_VAL(reqoid), ldap_err2string(rc), rc);
+ php_error_docref(NULL, E_WARNING, "Extended operation %pS failed: %s (%d)", reqoid,
ldap_err2string(rc), rc);
RETVAL_FALSE;
goto cleanup;
}
rc = ldap_result(ld->link, msgid, 1 /* LDAP_MSG_ALL */, NULL, &ldap_res);
if (rc == -1) {
- php_error_docref(NULL, E_WARNING, "Extended operation %s failed", ZSTR_VAL(reqoid));
+ php_error_docref(NULL, E_WARNING, "Extended operation %pS failed", reqoid);
RETVAL_FALSE;
goto cleanup;
}