]> granicus.if.org Git - php/commitdiff
fix: Incorrect error message
authorDmitry Stogov <dmitry@php.net>
Fri, 27 Feb 2004 12:49:00 +0000 (12:49 +0000)
committerDmitry Stogov <dmitry@php.net>
Fri, 27 Feb 2004 12:49:00 +0000 (12:49 +0000)
ext/soap/soap.c

index 0cf007e0fb6ac435e03166e96f063fc99f2cbe94..dd312b22d302464484ef4c67e92f6c6157df26b4 100644 (file)
@@ -979,7 +979,7 @@ PHP_METHOD(soapserver,setpersistence)
                                value == SOAP_PERSISTENCE_REQUEST) {
                                service->soap_class.persistance = value;
                        } else {
-                               php_error(E_ERROR, "Tried to set persistence with bogus value (%d)", value);
+                               php_error(E_ERROR, "Tried to set persistence with bogus value (%ld)", value);
                        }
                } else {
                        php_error(E_ERROR, "Tried to set persistence when you are using you SOAP SERVER in function mode, no persistence needed");
@@ -1293,10 +1293,17 @@ PHP_METHOD(soapserver, handle)
                                doc_request = soap_xmlParseMemory(Z_STRVAL_PP(raw_post),Z_STRLEN_PP(raw_post));
                        }
                } else {
-                       if (!zend_ini_long("always_populate_raw_post_data", sizeof("always_populate_raw_post_data"), 0)) {
-                               php_error(E_ERROR, "PHP-SOAP requires 'always_populate_raw_post_data' to be on please check your php.ini file");
+                       if (zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **)&server_vars) == SUCCESS) {
+                               zval **req_method;
+                               if (zend_hash_find(Z_ARRVAL_PP(server_vars), "REQUEST_METHOD", sizeof("REQUEST_METHOD"), (void **)&req_method) == SUCCESS) {
+                                       if (!strcmp(Z_STRVAL_PP(req_method), "POST")) {
+                                               if (!zend_ini_long("always_populate_raw_post_data", sizeof("always_populate_raw_post_data"), 0)) {
+                                                       php_error(E_ERROR, "PHP-SOAP requires 'always_populate_raw_post_data' to be on please check your php.ini file");
+                                               }
+                                       }
+                               }
                        }
-                       php_error(E_ERROR, "Can't find HTTP_RAW_POST_DATA");
+                       php_error(E_ERROR, "Bad Request. Can't find HTTP_RAW_POST_DATA");
                        return;
                }
        } else {