]> granicus.if.org Git - php/commitdiff
Fixed bug #30685 (Malformed SOAPClient http header reequest).
authorDmitry Stogov <dmitry@php.net>
Thu, 4 Nov 2004 15:30:28 +0000 (15:30 +0000)
committerDmitry Stogov <dmitry@php.net>
Thu, 4 Nov 2004 15:30:28 +0000 (15:30 +0000)
ext/soap/php_http.c
ext/soap/soap.c

index 9c4d47624c372f07aa5148259909a875244ee8a5..ed2813abb795839c1627a1abcf084ada93f8671a 100644 (file)
@@ -388,14 +388,15 @@ try_again:
 */
                        "User-Agent: PHP SOAP 0.1\r\n");
                if (soap_version == SOAP_1_2) {
-                       smart_str_append_const(&soap_headers,"Content-Type: application/soap+xml; charset=\"utf-8");
+                       smart_str_append_const(&soap_headers,"Content-Type: application/soap+xml; charset=utf-8");
                        if (soapaction) {
-                               smart_str_append_const(&soap_headers,"\"; action=\"");
+                               smart_str_append_const(&soap_headers,"; action=\"");
                                smart_str_appends(&soap_headers, soapaction);
+                               smart_str_append_const(&soap_headers,"\"");
                        }
-                       smart_str_append_const(&soap_headers,"\"\r\n");
+                       smart_str_append_const(&soap_headers,"\r\n");
                } else {
-                       smart_str_append_const(&soap_headers,"Content-Type: text/xml; charset=\"utf-8\"\r\n");
+                       smart_str_append_const(&soap_headers,"Content-Type: text/xml; charset=utf-8\r\n");
                        if (soapaction) {
                                smart_str_append_const(&soap_headers, "SOAPAction: \"");
                                smart_str_appends(&soap_headers, soapaction);
index 53486966d70f35d4c2f72a6aedd7f72ac0efbaed..5038f9da18d4fcd6aa2d053db727ffd23f2aba81 100644 (file)
@@ -1296,7 +1296,7 @@ PHP_METHOD(SoapServer, handle)
                                                INIT_ZVAL(readfile_ret);
                                                MAKE_STD_ZVAL(param);
 
-                                               sapi_add_header("Content-Type: text/xml; charset=\"utf-8\"", sizeof("Content-Type: text/xml; charset=\"utf-8\"")-1, 1);
+                                               sapi_add_header("Content-Type: text/xml; charset=utf-8", sizeof("Content-Type: text/xml; charset=utf-8")-1, 1);
                                                ZVAL_STRING(param, service->sdl->source, 1);
                                                ZVAL_STRING(&readfile, "readfile", 1);
                                                if (call_user_function(EG(function_table), NULL, &readfile, &readfile_ret, 1, &param  TSRMLS_CC) == FAILURE) {
@@ -1312,7 +1312,7 @@ PHP_METHOD(SoapServer, handle)
                                        } else {
                                                soap_server_fault("Server", "WSDL generation is not supported yet", NULL, NULL, NULL TSRMLS_CC);
 /*
-                                               sapi_add_header("Content-Type: text/xml; charset=\"utf-8\"", sizeof("Content-Type: text/xml; charset=\"utf-8\""), 1);
+                                               sapi_add_header("Content-Type: text/xml; charset=utf-8", sizeof("Content-Type: text/xml; charset=utf-8"), 1);
                                                PUTS("<?xml version=\"1.0\" ?>\n<definitions\n");
                                                PUTS("    xmlns=\"http://schemas.xmlsoap.org/wsdl/\"\n");
                                                PUTS("    targetNamespace=\"");
@@ -1661,9 +1661,9 @@ PHP_METHOD(SoapServer, handle)
        sprintf(cont_len, "Content-Length: %d", size);
        sapi_add_header(cont_len, strlen(cont_len), 1);
        if (soap_version == SOAP_1_2) {
-               sapi_add_header("Content-Type: application/soap+xml; charset=\"utf-8\"", sizeof("Content-Type: application/soap+xml; charset=\"utf-8\"")-1, 1);
+               sapi_add_header("Content-Type: application/soap+xml; charset=utf-8", sizeof("Content-Type: application/soap+xml; charset=utf-8")-1, 1);
        } else {
-               sapi_add_header("Content-Type: text/xml; charset=\"utf-8\"", sizeof("Content-Type: text/xml; charset=\"utf-8\"")-1, 1);
+               sapi_add_header("Content-Type: text/xml; charset=utf-8", sizeof("Content-Type: text/xml; charset=utf-8")-1, 1);
        }
 
        xmlFreeDoc(doc_return);
@@ -1748,9 +1748,9 @@ static void soap_server_fault_ex(sdlFunctionPtr function, zval* fault, soapHeade
        sprintf(cont_len,"Content-Length: %d", size);
        sapi_add_header(cont_len, strlen(cont_len), 1);
        if (soap_version == SOAP_1_2) {
-               sapi_add_header("Content-Type: application/soap+xml; charset=\"utf-8\"", sizeof("Content-Type: application/soap+xml; charset=\"utf-8\"")-1, 1);
+               sapi_add_header("Content-Type: application/soap+xml; charset=utf-8", sizeof("Content-Type: application/soap+xml; charset=utf-8")-1, 1);
        } else {
-               sapi_add_header("Content-Type: text/xml; charset=\"utf-8\"", sizeof("Content-Type: text/xml; charset=\"utf-8\"")-1, 1);
+               sapi_add_header("Content-Type: text/xml; charset=utf-8", sizeof("Content-Type: text/xml; charset=utf-8")-1, 1);
        }
        php_write(buf, size TSRMLS_CC);