]> granicus.if.org Git - php/commitdiff
XML parsing warnings and notices were disabled.
authorDmitry Stogov <dmitry@php.net>
Tue, 13 Jan 2004 09:31:50 +0000 (09:31 +0000)
committerDmitry Stogov <dmitry@php.net>
Tue, 13 Jan 2004 09:31:50 +0000 (09:31 +0000)
ext/soap/php_http.c
ext/soap/php_packet_soap.c
ext/soap/php_sdl.c
ext/soap/soap.c

index 865161b9f0e4302d4b14f95fe834a6fcda96ea79..d93568429e1cb575f46aba71f068fc5725fa73a6 100644 (file)
@@ -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);
index 4b7044ba307d7f0eb8879229feaf414915be0896..e9277668c9f2d9ae4de185c5922bf03252e75f5b 100644 (file)
@@ -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;
index 507f5619f0babea05942f83e38e2a810935ea7c2..f89d8a51356b94c63e53b33e4cc76ec5bb73a7ce 100644 (file)
@@ -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);
        }
index 8d7318022a490f9338991f4ab2c030da285ecb37..1c966c58797f5b6b79cbc6ecacd876f134ba89ad 100644 (file)
@@ -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");
                }