summaryrefslogtreecommitdiff
path: root/ext/soap/php_sdl.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2012-02-01 11:26:57 +0000
committerDmitry Stogov <dmitry@php.net>2012-02-01 11:26:57 +0000
commit43a0ee73a1717d90cfe9b123db2d6f7f9bb6baae (patch)
tree5f331f18248ce791055e133a77a73876c2d9704c /ext/soap/php_sdl.c
parent0e0d79218f06489286c42e1a6d0c686383071552 (diff)
downloadphp-git-43a0ee73a1717d90cfe9b123db2d6f7f9bb6baae.tar.gz
Fixed basic HTTP authentication for WSDL sub requests
Diffstat (limited to 'ext/soap/php_sdl.c')
-rw-r--r--ext/soap/php_sdl.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c
index 13bfe3ff2f..26f03a8084 100644
--- a/ext/soap/php_sdl.c
+++ b/ext/soap/php_sdl.c
@@ -242,6 +242,40 @@ void sdl_set_uri_credentials(sdlCtx *ctx, char *uri TSRMLS_DC)
if (!s) return;
s = strchr(s+3, '/');
l2 = s - (char*)uri;
+ if (l1 != l2) {
+ /* check for http://...:80/ */
+ if (l1 > 11 &&
+ ctx->sdl->source[4] == ':' &&
+ ctx->sdl->source[l1-3] == ':' &&
+ ctx->sdl->source[l1-2] == '8' &&
+ ctx->sdl->source[l1-1] == '0') {
+ l1 -= 3;
+ }
+ if (l2 > 11 &&
+ uri[4] == ':' &&
+ uri[l2-3] == ':' &&
+ uri[l2-2] == '8' &&
+ uri[l2-1] == '0') {
+ l2 -= 3;
+ }
+ /* check for https://...:443/ */
+ if (l1 > 13 &&
+ ctx->sdl->source[4] == 's' &&
+ ctx->sdl->source[l1-4] == ':' &&
+ ctx->sdl->source[l1-3] == '4' &&
+ ctx->sdl->source[l1-2] == '4' &&
+ ctx->sdl->source[l1-1] == '3') {
+ l1 -= 4;
+ }
+ if (l2 > 13 &&
+ uri[4] == 's' &&
+ uri[l2-4] == ':' &&
+ uri[l2-3] == '4' &&
+ uri[l2-2] == '4' &&
+ uri[l2-1] == '3') {
+ l2 -= 4;
+ }
+ }
if (l1 != l2 || memcmp(ctx->sdl->source, uri, l1) != 0) {
/* another server. clear authentication credentals */
context = php_libxml_switch_context(NULL TSRMLS_CC);