php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30685 Malformed SOAPClient http header reequest
Submitted: 2004-11-04 15:16 UTC Modified: 2004-11-09 07:34 UTC
From: lagoni at dsw dot dk Assigned: dmitry (profile)
Status: Closed Package: SOAP related
PHP Version: 5.0.2 OS: Fedora Core 2
Private report: No CVE-ID: None
 [2004-11-04 15:16 UTC] lagoni at dsw dot dk
Description:
------------
Description:
------------
I found a error in the implementation of the http header in the SOAP extension.
The error also exist in the newest CVS version.

According to the HTTP 1.1 RFC2616, section 3.4:

?HTTP character sets are identified by case-insensitive tokens. The complete set of tokens is defined by the IANA Character Set registry[19].

          charset = token
?
The extension is wrapping double quotes around the torken of the charset tag.

I tried to patch it, and it seems to work:

--- php_http.c.orig	2004-06-22 14:42:17.000000000 +0200
+++ php_http.c	2004-11-04 15:02:48.588726799 +0100
@@ -390,14 +390,14 @@
 */
 			"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_appends(&soap_headers, soapaction);
 			}
 			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);



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-11-09 07:34 UTC] dmitry@php.net
Fixed in CVS PHP_5_0 and HEAD.
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Tue Nov 13 16:01:26 2018 UTC