Skip to content

Commit dc7c5eb

Browse files
committed
Fixed basic HTTP authentication for WSDL sub requests
1 parent 93c5499 commit dc7c5eb

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

NEWS

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ PHP NEWS
1616
. Fixed bug #60860 (session.save_handler=user without defined function core
1717
dumps). (Felipe)
1818

19+
- SOAP:
20+
. Fixed basic HTTP authentication for WSDL sub requests. (Dmitry)
21+
1922
19 Jan 2012, PHP 5.4.0 RC6
2023

2124
- Core:

ext/soap/php_sdl.c

+34
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,40 @@ void sdl_set_uri_credentials(sdlCtx *ctx, char *uri TSRMLS_DC)
242242
if (!s) return;
243243
s = strchr(s+3, '/');
244244
l2 = s - (char*)uri;
245+
if (l1 != l2) {
246+
/* check for http://...:80/ */
247+
if (l1 > 11 &&
248+
ctx->sdl->source[4] == ':' &&
249+
ctx->sdl->source[l1-3] == ':' &&
250+
ctx->sdl->source[l1-2] == '8' &&
251+
ctx->sdl->source[l1-1] == '0') {
252+
l1 -= 3;
253+
}
254+
if (l2 > 11 &&
255+
uri[4] == ':' &&
256+
uri[l2-3] == ':' &&
257+
uri[l2-2] == '8' &&
258+
uri[l2-1] == '0') {
259+
l2 -= 3;
260+
}
261+
/* check for https://...:443/ */
262+
if (l1 > 13 &&
263+
ctx->sdl->source[4] == 's' &&
264+
ctx->sdl->source[l1-4] == ':' &&
265+
ctx->sdl->source[l1-3] == '4' &&
266+
ctx->sdl->source[l1-2] == '4' &&
267+
ctx->sdl->source[l1-1] == '3') {
268+
l1 -= 4;
269+
}
270+
if (l2 > 13 &&
271+
uri[4] == 's' &&
272+
uri[l2-4] == ':' &&
273+
uri[l2-3] == '4' &&
274+
uri[l2-2] == '4' &&
275+
uri[l2-1] == '3') {
276+
l2 -= 4;
277+
}
278+
}
245279
if (l1 != l2 || memcmp(ctx->sdl->source, uri, l1) != 0) {
246280
/* another server. clear authentication credentals */
247281
context = php_libxml_switch_context(NULL TSRMLS_CC);

0 commit comments

Comments
 (0)