mirror of
https://github.com/php/php-src.git
synced 2025-08-16 22:18:50 +02:00
XML parsing warnings and notices were disabled.
This commit is contained in:
parent
51c86ab73f
commit
fceb95f12a
4 changed files with 22 additions and 2 deletions
|
@ -306,7 +306,7 @@ int get_http_soap_response(zval *this_ptr, char **buffer, int *buffer_len TSRMLS
|
||||||
http_close = TRUE;
|
http_close = TRUE;
|
||||||
connection = get_http_header_value(http_headers,"Connection: ");
|
connection = get_http_header_value(http_headers,"Connection: ");
|
||||||
if (connection) {
|
if (connection) {
|
||||||
if (!strcmp(connection, "Keep-Alive")) {
|
if (strncasecmp(connection, "Keep-Alive", sizeof("Keep-Alive")-1) == 0) {
|
||||||
http_close = FALSE;
|
http_close = FALSE;
|
||||||
}
|
}
|
||||||
efree(connection);
|
efree(connection);
|
||||||
|
@ -331,7 +331,8 @@ int get_http_soap_response(zval *this_ptr, char **buffer, int *buffer_len TSRMLS
|
||||||
cmplen = strlen(content_type);
|
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)) {
|
if (strncmp(http_body, "<?xml", 5)) {
|
||||||
zval *err;
|
zval *err;
|
||||||
MAKE_STD_ZVAL(err);
|
MAKE_STD_ZVAL(err);
|
||||||
|
|
|
@ -7,12 +7,19 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
|
||||||
xmlDocPtr response;
|
xmlDocPtr response;
|
||||||
xmlNodePtr trav, env, head, body, resp, cur, fault;
|
xmlNodePtr trav, env, head, body, resp, cur, fault;
|
||||||
int param_count = 0;
|
int param_count = 0;
|
||||||
|
int old_error_reporting;
|
||||||
|
|
||||||
ZVAL_NULL(return_value);
|
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 */
|
/* Parse XML packet */
|
||||||
response = xmlParseMemory(buffer, buffer_size);
|
response = xmlParseMemory(buffer, buffer_size);
|
||||||
xmlCleanupParser();
|
xmlCleanupParser();
|
||||||
|
|
||||||
|
EG(error_reporting) = old_error_reporting;
|
||||||
|
|
||||||
if (!response) {
|
if (!response) {
|
||||||
add_soap_fault(this_ptr, "SOAP-ENV:Client", "looks like we got no XML document", NULL, NULL TSRMLS_CC);
|
add_soap_fault(this_ptr, "SOAP-ENV:Client", "looks like we got no XML document", NULL, NULL TSRMLS_CC);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -647,12 +647,19 @@ static void load_wsdl_ex(char *struri, sdlCtx *ctx, int include)
|
||||||
xmlDocPtr wsdl;
|
xmlDocPtr wsdl;
|
||||||
xmlNodePtr root, definitions, trav;
|
xmlNodePtr root, definitions, trav;
|
||||||
xmlAttrPtr targetNamespace;
|
xmlAttrPtr targetNamespace;
|
||||||
|
int old_error_reporting;
|
||||||
|
|
||||||
/* TODO: WSDL Caching */
|
/* 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);
|
wsdl = xmlParseFile(struri);
|
||||||
xmlCleanupParser();
|
xmlCleanupParser();
|
||||||
|
|
||||||
|
EG(error_reporting) = old_error_reporting;
|
||||||
|
|
||||||
|
|
||||||
if (!wsdl) {
|
if (!wsdl) {
|
||||||
php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Couldn't load from %s", struri);
|
php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Couldn't load from %s", struri);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
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)) {
|
&& ((*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));
|
doc_request = xmlParseMemory(Z_STRVAL_PP(raw_post),Z_STRLEN_PP(raw_post));
|
||||||
xmlCleanupParser();
|
xmlCleanupParser();
|
||||||
|
|
||||||
|
EG(error_reporting) = old_error_reporting;
|
||||||
|
|
||||||
if (doc_request == NULL) {
|
if (doc_request == NULL) {
|
||||||
php_error(E_ERROR, "Bad Request");
|
php_error(E_ERROR, "Bad Request");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue