Commit 256ef3e816f for php
commit 256ef3e816fd0e5e15b01430760c3a2c3e9242b7
Author: Daniel Scherzer <daniel.e.scherzer@gmail.com>
Date: Sat Aug 8 12:57:02 2026 -0700
[`%pS` migration] Use `%pS` in ext/standard/ftp_fopen_wrapper.c
diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c
index 97879a5c700..c3042814f8a 100644
--- a/ext/standard/ftp_fopen_wrapper.c
+++ b/ext/standard/ftp_fopen_wrapper.c
@@ -157,7 +157,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char
resource->port = 21;
char *transport;
- size_t transport_len = spprintf(&transport, 0, "tcp://%s:" ZEND_LONG_FMT, ZSTR_VAL(resource->host), resource->port);
+ size_t transport_len = spprintf(&transport, 0, "tcp://%pS:" ZEND_LONG_FMT, resource->host, resource->port);
stream = php_stream_xport_create(transport, transport_len, REPORT_ERRORS, STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT, NULL, NULL, context, NULL, NULL);
efree(transport);
if (stream == NULL) {
@@ -254,7 +254,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char
PHP_FTP_CNTRL_CHK(ZSTR_VAL(resource->user), ZSTR_LEN(resource->user), "Invalid login %s")
- php_stream_printf(stream, "USER %s\r\n", ZSTR_VAL(resource->user));
+ php_stream_printf(stream, "USER %pS\r\n", resource->user);
} else {
php_stream_write_string(stream, "USER anonymous\r\n");
}
@@ -271,12 +271,12 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char
PHP_FTP_CNTRL_CHK(ZSTR_VAL(resource->password), ZSTR_LEN(resource->password), "Invalid password %s")
- php_stream_printf(stream, "PASS %s\r\n", ZSTR_VAL(resource->password));
+ php_stream_printf(stream, "PASS %pS\r\n", resource->password);
} else {
/* if the user has configured who they are,
send that as the password */
if (FG(from_address)) {
- php_stream_printf(stream, "PASS %s\r\n", ZSTR_VAL(FG(from_address)));
+ php_stream_printf(stream, "PASS %pS\r\n", FG(from_address));
} else {
php_stream_write_string(stream, "PASS anonymous\r\n");
}
@@ -478,7 +478,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa
goto errexit;
/* find out the size of the file (verifying it exists) */
- php_stream_printf(stream, "SIZE %s\r\n", ZSTR_VAL(resource->path));
+ php_stream_printf(stream, "SIZE %pS\r\n", resource->path);
/* read the response */
result = GET_FTP_RESULT(stream);
@@ -507,7 +507,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa
if (allow_overwrite) {
/* Context permits overwriting file,
so we just delete whatever's there in preparation */
- php_stream_printf(stream, "DELE %s\r\n", ZSTR_VAL(resource->path));
+ php_stream_printf(stream, "DELE %pS\r\n", resource->path);
result = GET_FTP_RESULT(stream);
if (result >= 300 || result <= 199) {
goto errexit;
@@ -614,7 +614,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa
if (error_message) {
php_stream_wrapper_log_warn(wrapper, context, options, NetworkSendFailed,
- "Failed to set up data channel: %s", ZSTR_VAL(error_message));
+ "Failed to set up data channel: %pS", error_message);
zend_string_release(error_message);
}
return NULL;
@@ -935,7 +935,7 @@ static int php_stream_ftp_unlink(php_stream_wrapper *wrapper, const char *url, i
}
/* Attempt to delete the file */
- php_stream_printf(stream, "DELE %s\r\n", ZSTR_VAL(resource->path));
+ php_stream_printf(stream, "DELE %pS\r\n", resource->path);
result = GET_FTP_RESULT(stream);
if (result < 200 || result > 299) {
@@ -1003,12 +1003,12 @@ static int php_stream_ftp_rename(php_stream_wrapper *wrapper, const char *url_fr
stream = php_ftp_fopen_connect(wrapper, url_from, "r", 0, NULL, context, NULL, NULL, NULL, NULL);
if (!stream) {
php_stream_wrapper_warn(wrapper, context, options, AuthFailed,
- "Unable to connect to %s", ZSTR_VAL(resource_from->host));
+ "Unable to connect to %pS", resource_from->host);
goto rename_errexit;
}
/* Rename FROM */
- php_stream_printf(stream, "RNFR %s\r\n", ZSTR_VAL(resource_from->path));
+ php_stream_printf(stream, "RNFR %pS\r\n", resource_from->path);
result = GET_FTP_RESULT(stream);
if (result < 300 || result > 399) {
@@ -1018,7 +1018,7 @@ static int php_stream_ftp_rename(php_stream_wrapper *wrapper, const char *url_fr
}
/* Rename TO */
- php_stream_printf(stream, "RNTO %s\r\n", ZSTR_VAL(resource_to->path));
+ php_stream_printf(stream, "RNTO %pS\r\n", resource_to->path);
result = GET_FTP_RESULT(stream);
if (result < 200 || result > 299) {
@@ -1066,7 +1066,7 @@ static int php_stream_ftp_mkdir(php_stream_wrapper *wrapper, const char *url, in
}
if (!recursive) {
- php_stream_printf(stream, "MKD %s\r\n", ZSTR_VAL(resource->path));
+ php_stream_printf(stream, "MKD %pS\r\n", resource->path);
result = GET_FTP_RESULT(stream);
} else {
/* we look for directory separator from the end of string, thus hopefully reducing our work load */
@@ -1154,7 +1154,7 @@ static int php_stream_ftp_rmdir(php_stream_wrapper *wrapper, const char *url, in
goto rmdir_errexit;
}
- php_stream_printf(stream, "RMD %s\r\n", ZSTR_VAL(resource->path));
+ php_stream_printf(stream, "RMD %pS\r\n", resource->path);
result = GET_FTP_RESULT(stream);
if (result < 200 || result > 299) {