summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2008-02-15 06:50:39 +0000
committerDmitry Stogov <dmitry@php.net>2008-02-15 06:50:39 +0000
commit5ef434d17580ad2602c4a0dd68229f70d9d3ef83 (patch)
treee90a02524b37707d9e1c39dea4574aacc8a3621c
parent0be31f3f3ce02c7a36d5ddba1cf29d2e857de782 (diff)
downloadphp-git-5ef434d17580ad2602c4a0dd68229f70d9d3ef83.tar.gz
Fixed bug #43507 (SOAPFault HTTP Status 500 - would like to be able to set the HTTP Status)
-rw-r--r--NEWS2
-rw-r--r--ext/soap/soap.c14
2 files changed, 15 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 9e39610d42..edda002cd0 100644
--- a/NEWS
+++ b/NEWS
@@ -50,6 +50,8 @@ PHP NEWS
timezone). (Derick)
- Fixed bug #43522 (stream_get_line() eats additional characters). (Felipe,
Ilia, Tony)
+- Fixed bug #43507 (SOAPFault HTTP Status 500 - would like to be able to set
+ the HTTP Status). (Dmitry)
- Fixed bug #43505 (Assign by reference bug). (Dmitry)
- Fixed bug #43497 (OCI8 XML/getClobVal aka temporary LOBs leak UGA memory).
(Chris)
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index faf9feef23..5fda0c95b3 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -2007,6 +2007,8 @@ static void soap_server_fault_ex(sdlFunctionPtr function, zval* fault, soapHeade
char cont_len[30];
int size;
xmlDocPtr doc_return;
+ zval **agent_name;
+ int use_http_error_status = 1;
soap_version = SOAP_GLOBAL(soap_version);
@@ -2014,11 +2016,21 @@ static void soap_server_fault_ex(sdlFunctionPtr function, zval* fault, soapHeade
xmlDocDumpMemory(doc_return, &buf, &size);
+ zend_is_auto_global("_SERVER", sizeof("_SERVER") - 1 TSRMLS_CC);
+ if (PG(http_globals)[TRACK_VARS_SERVER] &&
+ zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "HTTP_USER_AGENT", sizeof("HTTP_USER_AGENT"), (void **) &agent_name) == SUCCESS &&
+ Z_TYPE_PP(agent_name) == IS_STRING) {
+ if (strncmp(Z_STRVAL_PP(agent_name), "Shockwave Flash", sizeof("Shockwave Flash")-1) == 0) {
+ use_http_error_status = 0;
+ }
+ }
/*
Want to return HTTP 500 but apache wants to over write
our fault code with their own handling... Figure this out later
*/
- sapi_add_header("HTTP/1.1 500 Internal Service Error", sizeof("HTTP/1.1 500 Internal Service Error")-1, 1);
+ if (use_http_error_status) {
+ sapi_add_header("HTTP/1.1 500 Internal Service Error", sizeof("HTTP/1.1 500 Internal Service Error")-1, 1);
+ }
if (soap_version == SOAP_1_2) {
sapi_add_header("Content-Type: application/soap+xml; charset=utf-8", sizeof("Content-Type: application/soap+xml; charset=utf-8")-1, 1);
} else {