Commit 78c08651f9a for php.net
commit 78c08651f9ac920a3a56da897813a0af79c2fa53
Merge: a3ef478bd1a de39a14cc74
Author: Ilia Alshanetsky <ilia@ilia.ws>
Date: Sat Jun 20 18:13:42 2026 -0400
Merge branch 'PHP-8.5'
* PHP-8.5:
Fix SOAP client failing to follow a scheme-less redirect Location
diff --cc ext/soap/php_http.c
index 1d030caf9d4,c7f3732f298..e8433e7c4f6
--- a/ext/soap/php_http.c
+++ b/ext/soap/php_http.c
@@@ -1158,15 -1162,18 +1158,15 @@@ try_again
zend_string_release_ex(http_headers, 0);
zend_string_release_ex(http_body, 0);
if (new_uri->scheme == NULL && new_uri->path != NULL) {
- new_uri->scheme = new_uri->scheme ? zend_string_copy(new_uri->scheme) : NULL;
- new_uri->host = new_uri->host ? zend_string_copy(new_uri->host) : NULL;
- new_uri->port = new_uri->port;
+ new_uri->scheme = uri->scheme ? zend_string_copy(uri->scheme) : NULL;
+ new_uri->host = uri->host ? zend_string_copy(uri->host) : NULL;
+ new_uri->port = uri->port;
if (new_uri->path && ZSTR_VAL(new_uri->path)[0] != '/') {
- if (new_uri->path) {
- char *t = ZSTR_VAL(new_uri->path);
+ if (uri->path) {
+ char *t = ZSTR_VAL(uri->path);
char *p = strrchr(t, '/');
if (p) {
- zend_string *s = zend_string_alloc((p - t) + ZSTR_LEN(new_uri->path) + 2, 0);
- strncpy(ZSTR_VAL(s), t, (p - t) + 1);
- ZSTR_VAL(s)[(p - t) + 1] = 0;
- strcat(ZSTR_VAL(s), ZSTR_VAL(new_uri->path));
+ zend_string *s = zend_string_concat2(t, (p - t) + 1, ZSTR_VAL(new_uri->path), ZSTR_LEN(new_uri->path));
zend_string_release_ex(new_uri->path, 0);
new_uri->path = s;
}