summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2004-01-13 09:31:50 +0000
committerDmitry Stogov <dmitry@php.net>2004-01-13 09:31:50 +0000
commitfceb95f12a0dcda2413d8938c2589f6dd9e9cb3f (patch)
tree1f7f254587d52d4daf7f7cd1bb60cc3f6f50b85e
parent51c86ab73f7d61f547593afbd6edd5f3f022f9ba (diff)
downloadphp-git-fceb95f12a0dcda2413d8938c2589f6dd9e9cb3f.tar.gz
XML parsing warnings and notices were disabled.
-rw-r--r--ext/soap/php_http.c5
-rw-r--r--ext/soap/php_packet_soap.c7
-rw-r--r--ext/soap/php_sdl.c7
-rw-r--r--ext/soap/soap.c5
4 files changed, 22 insertions, 2 deletions
diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c
index 865161b9f0..d93568429e 100644
--- a/ext/soap/php_http.c
+++ b/ext/soap/php_http.c
@@ -306,7 +306,7 @@ int get_http_soap_response(zval *this_ptr, char **buffer, int *buffer_len TSRMLS
http_close = TRUE;
connection = get_http_header_value(http_headers,"Connection: ");
if (connection) {
- if (!strcmp(connection, "Keep-Alive")) {
+ if (strncasecmp(connection, "Keep-Alive", sizeof("Keep-Alive")-1) == 0) {
http_close = FALSE;
}
efree(connection);
@@ -331,7 +331,8 @@ int get_http_soap_response(zval *this_ptr, char **buffer, int *buffer_len TSRMLS
cmplen = strlen(content_type);
}
- if (strncmp(content_type, "text/xml", cmplen)) {
+ if (strncmp(content_type, "text/xml", cmplen) == 0 ||
+ strncmp(content_type, "application/soap+xml", cmplen == 0)) {
if (strncmp(http_body, "<?xml", 5)) {
zval *err;
MAKE_STD_ZVAL(err);
diff --git a/ext/soap/php_packet_soap.c b/ext/soap/php_packet_soap.c
index 4b7044ba30..e9277668c9 100644
--- a/ext/soap/php_packet_soap.c
+++ b/ext/soap/php_packet_soap.c
@@ -7,12 +7,19 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
xmlDocPtr response;
xmlNodePtr trav, env, head, body, resp, cur, fault;
int param_count = 0;
+ int old_error_reporting;
ZVAL_NULL(return_value);
+ old_error_reporting = EG(error_reporting);
+ EG(error_reporting) &= ~(E_WARNING|E_NOTICE|E_USER_WARNING|E_USER_NOTICE);
+
/* Parse XML packet */
response = xmlParseMemory(buffer, buffer_size);
xmlCleanupParser();
+
+ EG(error_reporting) = old_error_reporting;
+
if (!response) {
add_soap_fault(this_ptr, "SOAP-ENV:Client", "looks like we got no XML document", NULL, NULL TSRMLS_CC);
return FALSE;
diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c
index 507f5619f0..f89d8a5135 100644
--- a/ext/soap/php_sdl.c
+++ b/ext/soap/php_sdl.c
@@ -647,12 +647,19 @@ static void load_wsdl_ex(char *struri, sdlCtx *ctx, int include)
xmlDocPtr wsdl;
xmlNodePtr root, definitions, trav;
xmlAttrPtr targetNamespace;
+ int old_error_reporting;
/* TODO: WSDL Caching */
+ old_error_reporting = EG(error_reporting);
+ EG(error_reporting) &= ~(E_WARNING|E_NOTICE|E_USER_WARNING|E_USER_NOTICE);
+
wsdl = xmlParseFile(struri);
xmlCleanupParser();
+ EG(error_reporting) = old_error_reporting;
+
+
if (!wsdl) {
php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Couldn't load from %s", struri);
}
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index 8d7318022a..1c966c5879 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -1052,9 +1052,14 @@ PHP_METHOD(soapserver, handle)
if (zend_hash_find(&EG(symbol_table), HTTP_RAW_POST_DATA, sizeof(HTTP_RAW_POST_DATA), (void **) &raw_post)!=FAILURE
&& ((*raw_post)->type==IS_STRING)) {
+ int old_error_reporting = EG(error_reporting);
+ EG(error_reporting) &= ~(E_WARNING|E_NOTICE|E_USER_WARNING|E_USER_NOTICE);
+
doc_request = xmlParseMemory(Z_STRVAL_PP(raw_post),Z_STRLEN_PP(raw_post));
xmlCleanupParser();
+ EG(error_reporting) = old_error_reporting;
+
if (doc_request == NULL) {
php_error(E_ERROR, "Bad Request");
}