]> granicus.if.org Git - php/commitdiff
Fixed basic HTTP authentication for WSDL sub requests
authorDmitry Stogov <dmitry@php.net>
Wed, 1 Feb 2012 11:26:57 +0000 (11:26 +0000)
committerDmitry Stogov <dmitry@php.net>
Wed, 1 Feb 2012 11:26:57 +0000 (11:26 +0000)
NEWS
ext/soap/php_sdl.c

diff --git a/NEWS b/NEWS
index a1df805e5da817e0fe62ab866de11418fc11a4eb..26ba9c09799d40a29f8a840eae9683d0c1b2f328 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,9 @@ PHP                                                                        NEWS
   . Fixed bug #60860 (session.save_handler=user without defined function core
     dumps). (Felipe)
 
+- SOAP:
+  . Fixed basic HTTP authentication for WSDL sub requests. (Dmitry)
+
 19 Jan 2012, PHP 5.4.0 RC6
 
 - Core:
index 6fa40506cb95fe3433259bf5e462def2933ce59c..22b3fc60aa1c8e096c14a9e2a7e4f0c99fd3d361 100644 (file)
@@ -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);