diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c
index 2594be75fe15..4fe272ea6f13 100644
--- a/ext/soap/php_http.c
+++ b/ext/soap/php_http.c
@@ -19,15 +19,15 @@
#include "ext/uri/php_uri.h"
static char *get_http_header_value_nodup(char *headers, char *type, size_t *len);
-static char *get_http_header_value(char *headers, char *type);
-static zend_string *get_http_body(php_stream *socketd, int close, char *headers);
+static char *get_http_header_value(zend_string *headers, char *type);
+static zend_string *get_http_body(php_stream *socketd, bool close, zend_string *headers);
static zend_string *get_http_headers(php_stream *socketd);
#define smart_str_append_const(str, const) \
smart_str_appendl(str,const,sizeof(const)-1)
/* Proxy HTTP Authentication */
-int proxy_authentication(zval* this_ptr, smart_str* soap_headers)
+bool proxy_authentication(zval* this_ptr, smart_str* soap_headers)
{
zval *login = Z_CLIENT_PROXY_LOGIN_P(this_ptr);
if (Z_TYPE_P(login) == IS_STRING) {
@@ -44,15 +44,15 @@ int proxy_authentication(zval* this_ptr, smart_str* soap_headers)
smart_str_append_const(soap_headers, "Proxy-Authorization: Basic ");
smart_str_append(soap_headers, buf);
smart_str_append_const(soap_headers, "\r\n");
- zend_string_release_ex(buf, 0);
+ zend_string_release_ex(buf, false);
smart_str_free(&auth);
- return 1;
+ return true;
}
- return 0;
+ return false;
}
/* HTTP Authentication */
-int basic_authentication(zval* this_ptr, smart_str* soap_headers)
+bool basic_authentication(zval* this_ptr, smart_str* soap_headers)
{
zval *login = Z_CLIENT_LOGIN_P(this_ptr);
zval *use_digest = Z_CLIENT_USE_DIGEST_P(this_ptr);
@@ -70,11 +70,11 @@ int basic_authentication(zval* this_ptr, smart_str* soap_headers)
smart_str_append_const(soap_headers, "Authorization: Basic ");
smart_str_append(soap_headers, buf);
smart_str_append_const(soap_headers, "\r\n");
- zend_string_release_ex(buf, 0);
+ zend_string_release_ex(buf, false);
smart_str_free(&auth);
- return 1;
+ return true;
}
- return 0;
+ return false;
}
static void http_context_add_header(const char *s,
@@ -161,7 +161,7 @@ void http_context_headers(php_stream_context* context,
}
}
-static php_stream* http_connect(zval* this_ptr, php_uri *uri, int use_ssl, php_stream_context *context, int *use_proxy)
+static php_stream* http_connect(zval* this_ptr, php_uri *uri, bool use_ssl, php_stream_context *context, int *use_proxy)
{
php_stream *stream;
zval *tmp, ssl_proxy_peer_name;
@@ -334,7 +334,7 @@ static bool in_domain(const zend_string *host, const zend_string *domain)
}
}
-int make_http_soap_request(
+bool make_http_soap_request(
zval *this_ptr, zend_string *buf, zend_string *location, char *soapaction,
int soap_version, zend_string *uri_parser_class, zval *return_value
) {
@@ -346,14 +346,13 @@ int make_http_soap_request(
php_stream *stream;
zval *tmp;
int use_proxy = 0;
- int use_ssl;
zend_string *http_body;
char *content_type, *http_version, *cookie_itt;
size_t cookie_len;
- int http_close;
+ bool http_close;
zend_string *http_headers;
char *connection;
- int http_1_1;
+ bool http_1_1;
int http_status;
int content_type_xml = 0;
zend_long redirect_max = 20;
@@ -366,7 +365,7 @@ int make_http_soap_request(
bool has_cookies = false;
if (this_ptr == NULL || Z_TYPE_P(this_ptr) != IS_OBJECT) {
- return FALSE;
+ return false;
}
request = buf;
@@ -412,7 +411,7 @@ int make_http_soap_request(
zend_string_release_ex(request, 0);
}
smart_str_free(&soap_headers_z);
- return FALSE;
+ return false;
}
}
}
@@ -432,7 +431,7 @@ int make_http_soap_request(
const php_uri_parser *uri_parser = php_uri_get_parser(uri_parser_class);
if (uri_parser == NULL) {
zend_argument_value_error(6, "must be a valid URI parser name");
- return FALSE;
+ return false;
}
uri = php_uri_parse_to_struct(uri_parser, ZSTR_VAL(location), ZSTR_LEN(location), PHP_URI_COMPONENT_READ_MODE_RAW, true);
}
@@ -461,12 +460,12 @@ int make_http_soap_request(
add_soap_fault(this_ptr, "HTTP", "Unable to parse URL", NULL, NULL, soap_lang_en);
smart_str_free(&soap_headers_z);
efree(http_msg);
- return FALSE;
+ return false;
}
- use_ssl = 0;
+ bool use_ssl = false;
if (uri->scheme != NULL && zend_string_equals_literal(uri->scheme, "https")) {
- use_ssl = 1;
+ use_ssl = true;
} else if (uri->scheme == NULL || !zend_string_equals_literal(uri->scheme, "http")) {
php_uri_struct_free(uri);
if (request != buf) {
@@ -475,7 +474,7 @@ int make_http_soap_request(
add_soap_fault(this_ptr, "HTTP", "Unknown protocol. Only http and https are allowed.", NULL, NULL, soap_lang_en);
smart_str_free(&soap_headers_z);
efree(http_msg);
- return FALSE;
+ return false;
}
old_allow_url_fopen = PG(allow_url_fopen);
@@ -489,7 +488,7 @@ int make_http_soap_request(
PG(allow_url_fopen) = old_allow_url_fopen;
smart_str_free(&soap_headers_z);
efree(http_msg);
- return FALSE;
+ return false;
}
if (uri->port == 0) {
@@ -542,7 +541,7 @@ int make_http_soap_request(
PG(allow_url_fopen) = old_allow_url_fopen;
smart_str_free(&soap_headers_z);
efree(http_msg);
- return FALSE;
+ return false;
}
}
PG(allow_url_fopen) = old_allow_url_fopen;
@@ -565,9 +564,9 @@ int make_http_soap_request(
(tmp = php_stream_context_get_option(context, "http", "protocol_version")) != NULL &&
Z_TYPE_P(tmp) == IS_DOUBLE &&
Z_DVAL_P(tmp) == 1.0) {
- http_1_1 = 0;
+ http_1_1 = false;
} else {
- http_1_1 = 1;
+ http_1_1 = true;
}
smart_str_append_const(&soap_headers, "POST ");
@@ -694,7 +693,7 @@ int make_http_soap_request(
smart_str_free(&soap_headers_z);
smart_str_free(&soap_headers);
efree(http_msg);
- return FALSE;
+ return false;
}
php_hash_bin2hex(cnonce, nonce, sizeof(nonce));
@@ -912,14 +911,14 @@ int make_http_soap_request(
add_soap_fault(this_ptr, "HTTP", "Failed Sending HTTP SOAP request", NULL, NULL, soap_lang_en);
smart_str_free(&soap_headers_z);
efree(http_msg);
- return FALSE;
+ return false;
}
smart_str_free(&soap_headers);
} else {
add_soap_fault(this_ptr, "HTTP", "Failed to create stream??", NULL, NULL, soap_lang_en);
smart_str_free(&soap_headers_z);
efree(http_msg);
- return FALSE;
+ return false;
}
http_headers = NULL;
@@ -936,7 +935,7 @@ int make_http_soap_request(
add_soap_fault(this_ptr, "HTTP", "Error Fetching http headers", NULL, NULL, soap_lang_en);
smart_str_free(&soap_headers_z);
efree(http_msg);
- return FALSE;
+ return false;
}
if (client_trace) {
@@ -945,14 +944,14 @@ int make_http_soap_request(
}
/* Check to see what HTTP status was sent */
- http_1_1 = 0;
+ http_1_1 = false;
http_status = 0;
- http_version = get_http_header_value(ZSTR_VAL(http_headers), "HTTP/");
+ http_version = get_http_header_value(http_headers, "HTTP/");
if (http_version) {
char *tmp;
if (!strncmp(http_version,"1.1", 3)) {
- http_1_1 = 1;
+ http_1_1 = true;
}
tmp = strstr(http_version," ");
@@ -1069,41 +1068,41 @@ int make_http_soap_request(
/* See if the server requested a close */
if (http_1_1) {
- http_close = FALSE;
+ http_close = false;
if (use_proxy && !use_ssl) {
- connection = get_http_header_value(ZSTR_VAL(http_headers), "Proxy-Connection:");
+ connection = get_http_header_value(http_headers, "Proxy-Connection:");
if (connection) {
if (strncasecmp(connection, "close", sizeof("close")-1) == 0) {
- http_close = TRUE;
+ http_close = true;
}
efree(connection);
}
}
- if (http_close == FALSE) {
- connection = get_http_header_value(ZSTR_VAL(http_headers), "Connection:");
+ if (http_close == false) {
+ connection = get_http_header_value(http_headers, "Connection:");
if (connection) {
if (strncasecmp(connection, "close", sizeof("close")-1) == 0) {
- http_close = TRUE;
+ http_close = true;
}
efree(connection);
}
}
} else {
- http_close = TRUE;
+ http_close = true;
if (use_proxy && !use_ssl) {
- connection = get_http_header_value(ZSTR_VAL(http_headers), "Proxy-Connection:");
+ connection = get_http_header_value(http_headers, "Proxy-Connection:");
if (connection) {
if (strncasecmp(connection, "Keep-Alive", sizeof("Keep-Alive")-1) == 0) {
- http_close = FALSE;
+ http_close = false;
}
efree(connection);
}
}
- if (http_close == TRUE) {
- connection = get_http_header_value(ZSTR_VAL(http_headers), "Connection:");
+ if (http_close == true) {
+ connection = get_http_header_value(http_headers, "Connection:");
if (connection) {
if (strncasecmp(connection, "Keep-Alive", sizeof("Keep-Alive")-1) == 0) {
- http_close = FALSE;
+ http_close = false;
}
efree(connection);
}
@@ -1111,7 +1110,7 @@ int make_http_soap_request(
}
- http_body = get_http_body(stream, http_close, ZSTR_VAL(http_headers));
+ http_body = get_http_body(stream, http_close, http_headers);
if (!http_body) {
if (request != buf) {
zend_string_release_ex(request, 0);
@@ -1125,7 +1124,7 @@ int make_http_soap_request(
efree(http_msg);
}
smart_str_free(&soap_headers_z);
- return FALSE;
+ return false;
}
if (request != buf) {
@@ -1143,12 +1142,12 @@ int make_http_soap_request(
if (http_status >= 300 && http_status < 400) {
char *loc;
- if ((loc = get_http_header_value(ZSTR_VAL(http_headers), "Location:")) != NULL) {
+ if ((loc = get_http_header_value(http_headers, "Location:")) != NULL) {
const php_uri_parser *uri_parser = php_uri_get_parser(uri_parser_class);
if (uri_parser == NULL) {
efree(loc);
zend_argument_value_error(6, "must be a valid URI parser name");
- return FALSE;
+ return false;
}
php_uri *new_uri = php_uri_parse_to_struct(uri_parser, loc, strlen(loc), PHP_URI_COMPONENT_READ_MODE_RAW, true);
@@ -1185,7 +1184,7 @@ int make_http_soap_request(
add_soap_fault(this_ptr, "HTTP", "Redirection limit reached, aborting", NULL, NULL, soap_lang_en);
smart_str_free(&soap_headers_z);
efree(http_msg);
- return FALSE;
+ return false;
}
goto try_again;
@@ -1196,7 +1195,7 @@ int make_http_soap_request(
zval *digest = Z_CLIENT_DIGEST_P(this_ptr);
zval *login = Z_CLIENT_LOGIN_P(this_ptr);
zval *password = Z_CLIENT_PASSWORD_P(this_ptr);
- char *auth = get_http_header_value(ZSTR_VAL(http_headers), "WWW-Authenticate:");
+ char *auth = get_http_header_value(http_headers, "WWW-Authenticate:");
if (auth && strstr(auth, "Digest") == auth && Z_TYPE_P(digest) != IS_ARRAY
&& Z_TYPE_P(login) == IS_STRING && Z_TYPE_P(password) == IS_STRING) {
char *s;
@@ -1266,7 +1265,7 @@ int make_http_soap_request(
smart_str_free(&soap_headers_z);
/* Check and see if the server even sent a xml document */
- content_type = get_http_header_value(ZSTR_VAL(http_headers), "Content-Type:");
+ content_type = get_http_header_value(http_headers, "Content-Type:");
if (content_type) {
char *pos = NULL;
int cmplen;
@@ -1288,7 +1287,7 @@ int make_http_soap_request(
efree(content_type);
zend_string_release_ex(http_headers, 0);
efree(http_body);
- return FALSE;
+ return false;
}
*/
}
@@ -1296,7 +1295,7 @@ int make_http_soap_request(
}
/* Decompress response */
- content_encoding = get_http_header_value(ZSTR_VAL(http_headers), "Content-Encoding:");
+ content_encoding = get_http_header_value(http_headers, "Content-Encoding:");
if (content_encoding) {
zval retval;
zval params[1];
@@ -1319,7 +1318,7 @@ int make_http_soap_request(
efree(http_msg);
}
add_soap_fault(this_ptr, "HTTP", "Unknown Content-Encoding", NULL, NULL, soap_lang_en);
- return FALSE;
+ return false;
}
zend_call_known_function(decompression_fn, NULL, NULL, &retval, 1, params, NULL);
if (Z_TYPE(retval) == IS_STRING) {
@@ -1334,7 +1333,7 @@ int make_http_soap_request(
if (http_msg) {
efree(http_msg);
}
- return FALSE;
+ return false;
}
efree(content_encoding);
} else {
@@ -1366,7 +1365,7 @@ int make_http_soap_request(
ZVAL_UNDEF(return_value);
add_soap_fault(this_ptr, "HTTP", http_msg, NULL, NULL, soap_lang_en);
efree(http_msg);
- return FALSE;
+ return false;
}
}
@@ -1374,7 +1373,7 @@ int make_http_soap_request(
efree(http_msg);
}
- return TRUE;
+ return true;
}
static char *get_http_header_value_nodup(char *headers, char *type, size_t *len)
@@ -1430,12 +1429,12 @@ static char *get_http_header_value_nodup(char *headers, char *type, size_t *len)
return NULL;
}
-static char *get_http_header_value(char *headers, char *type)
+static char *get_http_header_value(zend_string *headers, char *type)
{
size_t len;
char *value;
- value = get_http_header_value_nodup(headers, type, &len);
+ value = get_http_header_value_nodup(ZSTR_VAL(headers), type, &len);
if (value) {
return estrndup(value, len);
@@ -1444,22 +1443,27 @@ static char *get_http_header_value(char *headers, char *type)
return NULL;
}
-static zend_string* get_http_body(php_stream *stream, int close, char *headers)
+static zend_string* get_http_body(php_stream *stream, bool close, zend_string *headers)
{
zend_string *http_buf = NULL;
char *header;
- int header_close = close, header_chunked = 0, header_length = 0, http_buf_size = 0;
+ bool header_close = close, header_chunked = false;
+ int header_length = 0, http_buf_size = 0;
if (!close) {
header = get_http_header_value(headers, "Connection:");
if (header) {
- if(!strncasecmp(header, "close", sizeof("close")-1)) header_close = 1;
+ if (!strncasecmp(header, "close", sizeof("close")-1)) {
+ header_close = true;
+ }
efree(header);
}
}
header = get_http_header_value(headers, "Transfer-Encoding:");
if (header) {
- if(!strncasecmp(header, "chunked", sizeof("chunked")-1)) header_chunked = 1;
+ if (!strncasecmp(header, "chunked", sizeof("chunked")-1)) {
+ header_chunked = true;
+ }
efree(header);
}
header = get_http_header_value(headers, "Content-Length:");
@@ -1473,9 +1477,8 @@ static zend_string* get_http_body(php_stream *stream, int close, char *headers)
}
if (header_chunked) {
- char ch, done, headerbuf[8192];
-
- done = FALSE;
+ char ch, headerbuf[8192];
+ bool done = false;
while (!done) {
int buf_size = 0;
@@ -1502,7 +1505,7 @@ static zend_string* get_http_body(php_stream *stream, int close, char *headers)
ssize_t len_read = php_stream_read(stream, http_buf->val + http_buf_size, buf_size - len_size);
if (len_read <= 0) {
/* Error or EOF */
- done = TRUE;
+ done = true;
break;
}
len_size += len_read;
@@ -1530,7 +1533,7 @@ static zend_string* get_http_body(php_stream *stream, int close, char *headers)
return NULL;
}
if (buf_size == 0) {
- done = TRUE;
+ done = true;
}
}
diff --git a/ext/soap/php_http.h b/ext/soap/php_http.h
index a01ea35f9849..4f13b79f1164 100644
--- a/ext/soap/php_http.h
+++ b/ext/soap/php_http.h
@@ -17,13 +17,13 @@
#ifndef PHP_HTTP_H
#define PHP_HTTP_H
-int make_http_soap_request(
+bool make_http_soap_request(
zval *this_ptr, zend_string *buf, zend_string *location, char *soapaction,
int soap_version, zend_string *uri_parser_class, zval *return_value
);
-int proxy_authentication(zval* this_ptr, smart_str* soap_headers);
-int basic_authentication(zval* this_ptr, smart_str* soap_headers);
+bool proxy_authentication(zval* this_ptr, smart_str* soap_headers);
+bool basic_authentication(zval* this_ptr, smart_str* soap_headers);
void http_context_headers(php_stream_context* context,
bool has_authorization,
bool has_proxy_authorization,
diff --git a/ext/soap/php_packet_soap.c b/ext/soap/php_packet_soap.c
index b3aceb413890..68ed9a7a7689 100644
--- a/ext/soap/php_packet_soap.c
+++ b/ext/soap/php_packet_soap.c
@@ -39,25 +39,25 @@ static void master_to_zval_with_doc_cleanup(zval *ret, encodePtr encode, xmlNode
}
/* SOAP client calls this function to parse response from SOAP server */
-bool parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctionPtr fn, char *fn_name, zval *return_value, zval *soap_headers)
+bool parse_packet_soap(zval *this_ptr, zend_string *buffer, sdlFunctionPtr fn, zval *return_value, zval *soap_headers)
{
- char* envelope_ns = NULL;
+ const char *envelope_ns = NULL;
xmlDocPtr response;
- xmlNodePtr trav, env, head, body, resp, cur, fault;
+ xmlNodePtr trav, env, head, body, resp, fault;
xmlAttrPtr attr;
- int param_count = 0;
+ uint32_t param_count = 0;
int soap_version = SOAP_1_1;
HashTable *hdrs = NULL;
ZVAL_NULL(return_value);
/* Response for one-way operation */
- if (buffer_size == 0) {
+ if (ZSTR_LEN(buffer) == 0) {
return true;
}
/* Parse XML packet */
- response = soap_xmlParseMemory(buffer, buffer_size);
+ response = soap_xmlParseMemory(ZSTR_VAL(buffer), ZSTR_LEN(buffer));
if (!response) {
add_soap_fault(this_ptr, "Client", "looks like we got no XML document", NULL, NULL, soap_lang_en);
@@ -107,7 +107,7 @@ bool parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctio
add_soap_fault(this_ptr, "Client", "encodingStyle cannot be specified on the Envelope", NULL, NULL, soap_lang_en);
xmlFreeDoc(response);
return false;
- } else if (strcmp((char*)attr->children->content, SOAP_1_1_ENC_NAMESPACE) != 0) {
+ } else if (strcmp((const char*)attr->children->content, SOAP_1_1_ENC_NAMESPACE) != 0) {
add_soap_fault(this_ptr, "Client", "Unknown data encoding style", NULL, NULL, soap_lang_en);
xmlFreeDoc(response);
return false;
@@ -196,7 +196,7 @@ bool parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctio
/* Check if
contains element */
fault = get_node_ex(body->children,"Fault",envelope_ns);
if (fault != NULL) {
- char *faultcode = NULL;
+ const char *faultcode = NULL;
zend_string *lang = ZSTR_EMPTY_ALLOC();
zend_string *faultstring = NULL, *faultactor = NULL;
zval details;
@@ -206,7 +206,7 @@ bool parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctio
if (soap_version == SOAP_1_1) {
tmp = get_node(fault->children, "faultcode");
if (tmp != NULL && tmp->children != NULL) {
- faultcode = (char*)tmp->children->content;
+ faultcode = (const char*)tmp->children->content;
}
tmp = get_node(fault->children, "faultstring");
@@ -234,7 +234,7 @@ bool parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctio
if (tmp != NULL && tmp->children != NULL) {
tmp = get_node(tmp->children, "Value");
if (tmp != NULL && tmp->children != NULL) {
- faultcode = (char*)tmp->children->content;
+ faultcode = (const char*)tmp->children->content;
}
}
@@ -261,7 +261,7 @@ bool parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctio
master_to_zval_with_doc_cleanup(&details, NULL, tmp, response);
}
}
- add_soap_fault(this_ptr, faultcode, faultstring ? ZSTR_VAL(faultstring) : NULL, faultactor ? ZSTR_VAL(faultactor) : NULL, &details, lang);
+ add_soap_fault(this_ptr, faultcode, faultstring ? ZSTR_VAL(faultstring) : NULL, faultactor, &details, lang);
if (faultstring) {
zend_string_release_ex(faultstring, 0);
}
@@ -287,16 +287,15 @@ bool parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctio
/* Function has WSDL description */
sdlParamPtr param = NULL;
xmlNodePtr val = NULL;
- char *name, *ns = NULL;
zval tmp;
sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)fn->bindingAttributes;
- int res_count;
hdrs = fnb->output.headers;
if (fn->responseParameters) {
- res_count = zend_hash_num_elements(fn->responseParameters);
+ uint32_t res_count = zend_hash_num_elements(fn->responseParameters);
ZEND_HASH_FOREACH_PTR(fn->responseParameters, param) {
+ const char *name, *ns = NULL;
if (fnb->style == SOAP_DOCUMENT) {
if (param->element) {
name = param->element->name;
@@ -314,7 +313,7 @@ bool parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctio
}
/* Get value of parameter */
- cur = get_node_ex(resp, name, ns);
+ xmlNodePtr cur = get_node_ex(resp, name, ns);
if (!cur) {
cur = get_node(resp, name);
/* TODO: produce warning invalid ns */
@@ -373,20 +372,22 @@ bool parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctio
if (val != NULL) {
if (!node_is_equal_ex(val,"result",RPC_SOAP12_NAMESPACE)) {
zval tmp;
- zval *arr;
master_to_zval_with_doc_cleanup(&tmp, NULL, val, response);
if (val->name) {
- if ((arr = zend_hash_str_find(Z_ARRVAL_P(return_value), (char*)val->name, strlen((char*)val->name))) != NULL) {
+ const char *val_name = (const char*) val->name;
+ size_t val_name_len = strlen(val_name);
+ zval *arr = zend_hash_str_find(Z_ARRVAL_P(return_value), val_name, val_name_len);
+ if (arr != NULL) {
add_next_index_zval(arr, &tmp);
- } else if (val->next && get_node(val->next, (char*)val->name)) {
- zval arr;
+ } else if (val->next && get_node(val->next, val_name)) {
+ zval new_arr;
- array_init(&arr);
- add_next_index_zval(&arr, &tmp);
- add_assoc_zval(return_value, (char*)val->name, &arr);
+ array_init(&new_arr);
+ add_next_index_zval(&new_arr, &tmp);
+ add_assoc_zval_ex(return_value, val_name, val_name_len, &new_arr);
} else {
- add_assoc_zval(return_value, (char*)val->name, &tmp);
+ add_assoc_zval_ex(return_value, val_name, val_name_len, &tmp);
}
} else {
add_next_index_zval(return_value, &tmp);
@@ -430,10 +431,10 @@ bool parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctio
sdlSoapBindingFunctionHeaderPtr hdr;
if (trav->ns) {
- smart_str_appends(&key, (char*)trav->ns->href);
+ smart_str_appends(&key, (const char*)trav->ns->href);
smart_str_appendc(&key,':');
}
- smart_str_appends(&key, (char*)trav->name);
+ smart_str_appends(&key, (const char*)trav->name);
smart_str_0(&key);
if ((hdr = zend_hash_find_ptr(hdrs, key.s)) != NULL) {
enc = hdr->encode;
@@ -441,7 +442,7 @@ bool parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctio
smart_str_free(&key);
}
master_to_zval_with_doc_cleanup(&val, enc, trav, response);
- add_assoc_zval(soap_headers, (char*)trav->name, &val);
+ add_assoc_zval(soap_headers, (const char*)trav->name, &val);
}
trav = trav->next;
}
diff --git a/ext/soap/php_packet_soap.h b/ext/soap/php_packet_soap.h
index 569b23949659..dc4b44176867 100644
--- a/ext/soap/php_packet_soap.h
+++ b/ext/soap/php_packet_soap.h
@@ -17,6 +17,6 @@
#ifndef PHP_PACKET_SOAP_H
#define PHP_PACKET_SOAP_H
-bool parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctionPtr fn, char *fn_name, zval *return_value, zval *soap_headers);
+bool parse_packet_soap(zval *this_ptr, zend_string *buffer, sdlFunctionPtr fn, zval *return_value, zval *soap_headers);
#endif
diff --git a/ext/soap/php_soap.h b/ext/soap/php_soap.h
index 58dbdfed6c05..f35f357ae394 100644
--- a/ext/soap/php_soap.h
+++ b/ext/soap/php_soap.h
@@ -195,7 +195,7 @@ extern zend_class_entry* soap_sdl_class_entry;
extern HashTable php_soap_defEncNs, php_soap_defEnc, php_soap_defEncIndex;
-void add_soap_fault(zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail, zend_string *lang);
+void add_soap_fault(zval *obj, const char *fault_code, const char *fault_string, zend_string *fault_actor, zval *fault_detail, zend_string *lang);
#define soap_error0(severity, format) \
php_error(severity, "SOAP-ERROR: " format)
diff --git a/ext/soap/php_xml.c b/ext/soap/php_xml.c
index d5daaef15983..a4c638410a73 100644
--- a/ext/soap/php_xml.c
+++ b/ext/soap/php_xml.c
@@ -148,7 +148,7 @@ xmlNsPtr node_find_ns(xmlNodePtr node)
}
}
-int attr_is_equal_ex(xmlAttrPtr node, const char *name, const char *ns)
+bool attr_is_equal_ex(xmlAttrPtr node, const char *name, const char *ns)
{
if (node->name && strcmp((const char *) node->name, name) == 0) {
xmlNsPtr nsPtr = node->ns;
@@ -156,17 +156,17 @@ int attr_is_equal_ex(xmlAttrPtr node, const char *name, const char *ns)
if (nsPtr) {
return (strcmp((const char *) nsPtr->href, ns) == 0);
} else {
- return FALSE;
+ return false;
}
} else if (nsPtr) {
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-int node_is_equal_ex(xmlNodePtr node, const char *name, const char *ns)
+bool node_is_equal_ex(xmlNodePtr node, const char *name, const char *ns)
{
if (name == NULL || ((node->name) && strcmp((char*)node->name, name) == 0)) {
if (ns) {
@@ -174,29 +174,29 @@ int node_is_equal_ex(xmlNodePtr node, const char *name, const char *ns)
if (nsPtr) {
return strcmp((const char *) nsPtr->href, ns) == 0;
} else {
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-int node_is_equal_ex_one_of(xmlNodePtr node, const char *name, const char *const *namespaces)
+bool node_is_equal_ex_one_of(xmlNodePtr node, const char *name, const char *const *namespaces)
{
if ((node->name) && strcmp((char*)node->name, name) == 0) {
xmlNsPtr nsPtr = node_find_ns(node);
if (nsPtr) {
do {
if (strcmp((const char *) nsPtr->href, *namespaces) == 0) {
- return TRUE;
+ return true;
}
namespaces++;
} while (*namespaces != NULL);
}
- return FALSE;
+ return false;
}
- return FALSE;
+ return false;
}
xmlAttrPtr get_attribute_any_ns(xmlAttrPtr node, const char *name)
diff --git a/ext/soap/php_xml.h b/ext/soap/php_xml.h
index 4a6d76427dd1..d87f4a758748 100644
--- a/ext/soap/php_xml.h
+++ b/ext/soap/php_xml.h
@@ -29,9 +29,9 @@ xmlDocPtr soap_xmlParseFile(const char *filename);
xmlDocPtr soap_xmlParseMemory(const void *buf, size_t size);
xmlNsPtr node_find_ns(xmlNodePtr node);
-int attr_is_equal_ex(xmlAttrPtr node, const char *name, const char *ns);
-int node_is_equal_ex(xmlNodePtr node, const char *name, const char *ns);
-int node_is_equal_ex_one_of(xmlNodePtr node, const char *name, const char *const *namespaces);
+bool attr_is_equal_ex(xmlAttrPtr node, const char *name, const char *ns);
+bool node_is_equal_ex(xmlNodePtr node, const char *name, const char *ns);
+bool node_is_equal_ex_one_of(xmlNodePtr node, const char *name, const char *const *namespaces);
xmlAttrPtr get_attribute_any_ns(xmlAttrPtr node, const char *name);
xmlAttrPtr get_attribute_ex(xmlAttrPtr node, const char *name, const char *ns);
xmlNodePtr get_node_ex(xmlNodePtr node, const char *name, const char *ns);
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index 83584283740d..d8f72e0191aa 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -48,13 +48,13 @@ static void function_to_string(sdlFunctionPtr function, smart_str *buf);
static void type_to_string(sdlTypePtr type, smart_str *buf, int level);
static void clear_soap_fault(zval *obj);
-static void set_soap_fault(zval *obj, const char *fault_code_ns, const char *fault_code, const char *fault_string, const char *fault_actor, zval *fault_detail, zend_string *name, zend_string *lang);
-static void add_soap_fault_en(zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail);
-static void add_soap_fault_ex(zval *fault, zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail, zend_string *lang);
-static void add_soap_fault_ex_en(zval *fault, zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail);
-static ZEND_NORETURN void soap_server_fault(char* code, char* string, char *actor, zval* details, zend_string *name, zend_string *lang);
+static void set_soap_fault(zval *obj, const char *fault_code_ns, const char *fault_code, const char *fault_string, zend_string *fault_actor, zval *fault_detail, zend_string *name, zend_string *lang);
+static void add_soap_fault_en(zval *obj, const char *fault_code, const char *fault_string);
+static void add_soap_fault_ex(zval *fault, zval *obj, const char *fault_code, const char *fault_string, zend_string *fault_actor, zval *fault_detail, zend_string *lang);
+static void add_soap_fault_ex_en(zval *fault, zval *obj, const char *fault_code, const char *fault_string);
+static ZEND_NORETURN void soap_server_fault(const char *code, const char *string, zend_string *actor, zval* details, zend_string *name, zend_string *lang);
static void soap_server_fault_ex(sdlFunctionPtr function, zval* fault, soapHeader* hdr);
-static ZEND_NORETURN void soap_server_fault_en(char* code, char* string, char *actor, zval* details, zend_string *name);
+static ZEND_NORETURN void soap_server_fault_en(const char *code, const char *string);
static sdlParamPtr get_param(sdlFunctionPtr function, const char *param_name, zend_ulong index, int);
static sdlFunctionPtr get_function(sdlPtr sdl, const char *function_name, size_t function_name_length);
@@ -693,8 +693,9 @@ static void soap_fault_dtor_properties(zval *obj)
/* {{{ SoapFault constructor */
PHP_METHOD(SoapFault, __construct)
{
- char *fault_string = NULL, *fault_code = NULL, *fault_actor = NULL, *fault_code_ns = NULL;
- size_t fault_string_len, fault_actor_len = 0, fault_code_len = 0;
+ char *fault_string = NULL, *fault_code = NULL, *fault_code_ns = NULL;
+ size_t fault_string_len, fault_code_len = 0;
+ zend_string *fault_actor = NULL;
zend_string *name = NULL;
zend_string *lang = ZSTR_EMPTY_ALLOC();
zval *details = NULL, *headerfault = NULL, *this_ptr;
@@ -705,7 +706,7 @@ PHP_METHOD(SoapFault, __construct)
Z_PARAM_ARRAY_HT_OR_STR_OR_NULL(code_ht, code_str)
Z_PARAM_STRING(fault_string, fault_string_len)
Z_PARAM_OPTIONAL
- Z_PARAM_STRING_OR_NULL(fault_actor, fault_actor_len)
+ Z_PARAM_STR_OR_NULL(fault_actor)
Z_PARAM_ZVAL_OR_NULL(details)
Z_PARAM_STR_OR_NULL(name)
Z_PARAM_ZVAL_OR_NULL(headerfault)
@@ -1285,10 +1286,10 @@ static void _soap_server_exception(soapServicePtr service, sdlFunctionPtr functi
if (service->send_errors) {
zval rv;
zend_string *msg = zval_get_string(zend_read_property_ex(zend_ce_error, Z_OBJ(exception_object), ZSTR_KNOWN(ZEND_STR_MESSAGE), /* silent */ false, &rv));
- add_soap_fault_ex_en(&exception_object, this_ptr, "Server", ZSTR_VAL(msg), NULL, NULL);
+ add_soap_fault_ex_en(&exception_object, this_ptr, "Server", ZSTR_VAL(msg));
zend_string_release_ex(msg, 0);
} else {
- add_soap_fault_ex_en(&exception_object, this_ptr, "Server", "Internal Error", NULL, NULL);
+ add_soap_fault_ex_en(&exception_object, this_ptr, "Server", "Internal Error");
}
soap_server_fault_ex(function, &exception_object, NULL);
}
@@ -1328,7 +1329,7 @@ PHP_METHOD(SoapServer, handle)
SOAP_GLOBAL(soap_version) = service->version;
if (arg && ZEND_SIZE_T_INT_OVFL(arg_len)) {
- soap_server_fault_en("Server", "Input string is too long", NULL, NULL, NULL);
+ soap_server_fault_en("Server", "Input string is too long");
SOAP_SERVER_END_CODE();
return;
}
@@ -1354,13 +1355,13 @@ PHP_METHOD(SoapServer, handle)
php_stream_passthru(stream);
php_stream_close(stream);
} else {
- soap_server_fault_en("Server", "Couldn't find WSDL", NULL, NULL, NULL);
+ soap_server_fault_en("Server", "Couldn't find WSDL");
}
SOAP_SERVER_END_CODE();
return;
} else {
- soap_server_fault_en("Server", "WSDL generation is not supported yet", NULL, NULL, NULL);
+ soap_server_fault_en("Server", "WSDL generation is not supported yet");
/*
sapi_add_header("Content-Type: text/xml; charset=utf-8", sizeof("Content-Type: text/xml; charset=utf-8"), 1);
PUTS("\nchildren,"Envelope");
@@ -1445,7 +1446,7 @@ PHP_METHOD(SoapServer, handle)
}
}
xmlFreeDoc(doc_request);
- soap_server_fault_en("Server", "DTD are not supported by SOAP", NULL, NULL, NULL);
+ soap_server_fault_en("Server", "DTD are not supported by SOAP");
}
old_sdl = SOAP_GLOBAL(sdl);
@@ -1503,7 +1504,7 @@ PHP_METHOD(SoapServer, handle)
soap_obj = tmp_soap_p;
} else if (Z_OBJCE_P(tmp_soap_p) == php_ce_incomplete_class) {
/* See #51561, communicate limitation to user */
- soap_server_fault_en("Server", "SoapServer class was deserialized from the session prior to loading the class passed to SoapServer::setClass(). Start the session after loading all classes to resolve this issue.", NULL, NULL, NULL);
+ soap_server_fault_en("Server", "SoapServer class was deserialized from the session prior to loading the class passed to SoapServer::setClass(). Start the session after loading all classes to resolve this issue.");
}
}
}
@@ -1562,7 +1563,7 @@ PHP_METHOD(SoapServer, handle)
#if 0
if (service->sdl && !h->function && !h->hdr) {
if (h->mustUnderstand) {
- soap_server_fault_en("MustUnderstand","Header not understood", NULL, NULL, NULL);
+ soap_server_fault_en("MustUnderstand","Header not understood");
} else {
continue;
}
@@ -1601,7 +1602,7 @@ PHP_METHOD(SoapServer, handle)
goto fail;
}
} else if (h->mustUnderstand) {
- soap_server_fault_en("MustUnderstand","Header not understood", NULL, NULL, NULL);
+ soap_server_fault_en("MustUnderstand","Header not understood");
}
}
}
@@ -1760,16 +1761,17 @@ PHP_METHOD(SoapServer, handle)
/* {{{ Issue SoapFault indicating an error */
PHP_METHOD(SoapServer, fault)
{
- char *code, *string, *actor=NULL;
- size_t code_len, string_len, actor_len = 0;
+ char *code, *string;
+ size_t code_len, string_len;
+ zend_string *actor = NULL;
zval* details = NULL;
zend_string *name = NULL;
zend_string *lang = ZSTR_EMPTY_ALLOC();
soapServicePtr service;
xmlCharEncodingHandlerPtr old_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|szSP",
- &code, &code_len, &string, &string_len, &actor, &actor_len, &details,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|SzSP",
+ &code, &code_len, &string, &string_len, &actor, &details,
&name, &lang) == FAILURE) {
RETURN_THROWS();
}
@@ -1875,7 +1877,7 @@ static void soap_server_fault_ex(sdlFunctionPtr function, zval* fault, soapHeade
}
/* }}} */
-static ZEND_NORETURN void soap_server_fault(char* code, char* string, char *actor, zval* details, zend_string* name, zend_string *lang) /* {{{ */
+static ZEND_NORETURN void soap_server_fault(const char *code, const char *string, zend_string *actor, zval* details, zend_string* name, zend_string *lang) /* {{{ */
{
zval ret;
@@ -1887,9 +1889,9 @@ static ZEND_NORETURN void soap_server_fault(char* code, char* string, char *acto
}
/* }}} */
-static ZEND_NORETURN void soap_server_fault_en(char* code, char* string, char *actor, zval* details, zend_string* name)
+static ZEND_NORETURN void soap_server_fault_en(const char *code, const char *string)
{
- soap_server_fault(code, string, actor, details, name, soap_lang_en);
+ soap_server_fault(code, string, NULL, NULL, NULL, soap_lang_en);
}
static zend_never_inline ZEND_COLD void soap_real_error_handler(int error_num, zend_string *error_filename, const uint32_t error_lineno, zend_string *message) /* {{{ */
@@ -1915,7 +1917,7 @@ static zend_never_inline ZEND_COLD void soap_real_error_handler(int error_num, z
code = "Client";
}
- add_soap_fault_ex_en(&fault, &SOAP_GLOBAL(error_object), code, ZSTR_VAL(message), NULL, NULL);
+ add_soap_fault_ex_en(&fault, &SOAP_GLOBAL(error_object), code, ZSTR_VAL(message));
Z_ADDREF(fault);
zend_throw_exception_object(&fault);
zend_bailout();
@@ -2267,7 +2269,7 @@ static bool do_request(zval *this_ptr, xmlDoc *request, const char *location, co
xmlDocDumpMemory(request, (xmlChar**)&buf, &buf_size);
if (!buf) {
- add_soap_fault_en(this_ptr, "HTTP", "Error build soap request", NULL, NULL);
+ add_soap_fault_en(this_ptr, "HTTP", "Error build soap request");
return false;
}
@@ -2297,7 +2299,7 @@ static bool do_request(zval *this_ptr, xmlDoc *request, const char *location, co
if (EG(exception) && instanceof_function(EG(exception)->ce, zend_ce_error)) {
/* Programmer error in __doRequest() implementation, let it bubble up. */
} else if (Z_TYPE_P(Z_CLIENT_SOAP_FAULT_P(this_ptr)) != IS_OBJECT) {
- add_soap_fault_en(this_ptr, "Client", "SoapClient::__doRequest() returned non string value", NULL, NULL);
+ add_soap_fault_en(this_ptr, "Client", "SoapClient::__doRequest() returned non string value");
}
ret = false;
} else if (Z_TYPE_P(trace) == IS_TRUE) {
@@ -2445,7 +2447,7 @@ static void do_soap_call(zend_execute_data *execute_data,
encode_reset_ns();
zend_try {
- ret = parse_packet_soap(this_ptr, Z_STRVAL(response), Z_STRLEN(response), fn, NULL, return_value, output_headers);
+ ret = parse_packet_soap(this_ptr, Z_STR(response), fn, return_value, output_headers);
} zend_catch {
parse_bailout = true;
} zend_end_try();
@@ -2464,15 +2466,15 @@ static void do_soap_call(zend_execute_data *execute_data,
smart_str_append(&error,function);
smart_str_appends(&error,"\") is not a valid method for this service");
smart_str_0(&error);
- add_soap_fault_en(this_ptr, "Client", ZSTR_VAL(error.s), NULL, NULL);
+ add_soap_fault_en(this_ptr, "Client", ZSTR_VAL(error.s));
smart_str_free(&error);
}
} else {
zval *uri = Z_CLIENT_URI_P(this_ptr);
if (Z_TYPE_P(uri) != IS_STRING) {
- add_soap_fault_en(this_ptr, "Client", "Error finding \"uri\" property", NULL, NULL);
+ add_soap_fault_en(this_ptr, "Client", "Error finding \"uri\" property");
} else if (location == NULL) {
- add_soap_fault_en(this_ptr, "Client", "Error could not find \"location\" property", NULL, NULL);
+ add_soap_fault_en(this_ptr, "Client", "Error could not find \"location\" property");
} else {
if (call_uri == NULL) {
call_uri = Z_STR_P(uri);
@@ -2499,7 +2501,7 @@ static void do_soap_call(zend_execute_data *execute_data,
encode_reset_ns();
zend_try {
- ret = parse_packet_soap(this_ptr, Z_STRVAL(response), Z_STRLEN(response), NULL, NULL, return_value, output_headers);
+ ret = parse_packet_soap(this_ptr, Z_STR(response), NULL, return_value, output_headers);
} zend_catch {
parse_bailout = true;
} zend_end_try();
@@ -2519,7 +2521,7 @@ static void do_soap_call(zend_execute_data *execute_data,
if (Z_TYPE_P(fault) == IS_OBJECT) {
ZVAL_COPY(return_value, fault);
} else {
- add_soap_fault_ex_en(return_value, this_ptr, "Client", "Unknown Error", NULL, NULL);
+ add_soap_fault_ex_en(return_value, this_ptr, "Client", "Unknown Error");
Z_ADDREF_P(return_value);
}
} else {
@@ -2953,7 +2955,7 @@ static void clear_soap_fault(zval *obj) /* {{{ */
}
/* }}} */
-static void add_soap_fault_ex(zval *fault, zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail, zend_string *lang) /* {{{ */
+static void add_soap_fault_ex(zval *fault, zval *obj, const char *fault_code, const char *fault_string, zend_string *fault_actor, zval *fault_detail, zend_string *lang) /* {{{ */
{
ZVAL_NULL(fault);
set_soap_fault(fault, NULL, fault_code, fault_string, fault_actor, fault_detail, NULL, lang);
@@ -2970,24 +2972,24 @@ static void add_soap_fault_ex(zval *fault, zval *obj, char *fault_code, char *fa
}
/* }}} */
-static void add_soap_fault_ex_en(zval *fault, zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail)
+static void add_soap_fault_ex_en(zval *fault, zval *obj, const char *fault_code, const char *fault_string)
{
- add_soap_fault_ex(fault, obj, fault_code, fault_string, fault_actor, fault_detail, soap_lang_en);
+ add_soap_fault_ex(fault, obj, fault_code, fault_string, NULL, NULL, soap_lang_en);
}
-void add_soap_fault(zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail, zend_string *lang) /* {{{ */
+void add_soap_fault(zval *obj, const char *fault_code, const char *fault_string, zend_string *fault_actor, zval *fault_detail, zend_string *lang) /* {{{ */
{
zval fault;
add_soap_fault_ex(&fault, obj, fault_code, fault_string, fault_actor, fault_detail, lang);
}
/* }}} */
-static void add_soap_fault_en(zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail)
+static void add_soap_fault_en(zval *obj, const char *fault_code, const char *fault_string)
{
- add_soap_fault(obj, fault_code, fault_string, fault_actor, fault_detail, soap_lang_en);
+ add_soap_fault(obj, fault_code, fault_string, NULL, NULL, soap_lang_en);
}
-static void set_soap_fault(zval *obj, const char *fault_code_ns, const char *fault_code, const char *fault_string, const char *fault_actor, zval *fault_detail, zend_string *name, zend_string *lang) /* {{{ */
+static void set_soap_fault(zval *obj, const char *fault_code_ns, const char *fault_code, const char *fault_string, zend_string *fault_actor, zval *fault_detail, zend_string *name, zend_string *lang) /* {{{ */
{
if (Z_TYPE_P(obj) != IS_OBJECT) {
object_init_ex(obj, soap_fault_class_entry);
@@ -3030,7 +3032,7 @@ static void set_soap_fault(zval *obj, const char *fault_code_ns, const char *fau
}
}
if (fault_actor != NULL) {
- ZVAL_STRING(Z_FAULT_ACTOR_P(obj), fault_actor);
+ ZVAL_STR_COPY(Z_FAULT_ACTOR_P(obj), fault_actor);
}
if (fault_detail != NULL && Z_TYPE_P(fault_detail) != IS_UNDEF) {
ZVAL_COPY(Z_FAULT_DETAIL_P(obj), fault_detail);
@@ -3109,7 +3111,7 @@ static void deserialize_parameters(xmlNodePtr params, sdlFunctionPtr function, u
sdlParamPtr param = NULL;
if (function != NULL &&
(param = zend_hash_index_find_ptr(function->requestParameters, cur_param)) == NULL) {
- soap_server_fault_en("Client", "Error cannot find parameter", NULL, NULL, NULL);
+ soap_server_fault_en("Client", "Error cannot find parameter");
}
if (param == NULL) {
enc = NULL;
@@ -3124,7 +3126,7 @@ static void deserialize_parameters(xmlNodePtr params, sdlFunctionPtr function, u
}
}
if (num_of_params > cur_param) {
- soap_server_fault_en("Client","Missing parameter", NULL, NULL, NULL);
+ soap_server_fault_en("Client","Missing parameter");
}
(*parameters) = tmp_parameters;
(*num_params) = num_of_params;
@@ -3215,7 +3217,7 @@ static xmlNodePtr get_envelope(xmlNodePtr trav, int *version, char **envelope_ns
return trav;
}
- soap_server_fault_en("VersionMismatch", "Wrong Version", NULL, NULL, NULL);
+ soap_server_fault_en("VersionMismatch", "Wrong Version");
}
trav = trav->next;
}
@@ -3235,18 +3237,18 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
/* Get element */
env = get_envelope(request->children, version, &envelope_ns);
if (!env) {
- soap_server_fault_en("Client", "looks like we got XML without \"Envelope\" element", NULL, NULL, NULL);
+ soap_server_fault_en("Client", "looks like we got XML without \"Envelope\" element");
}
attr = env->properties;
while (attr != NULL) {
if (attr->ns == NULL) {
- soap_server_fault_en("Client", "A SOAP Envelope element cannot have non Namespace qualified attributes", NULL, NULL, NULL);
+ soap_server_fault_en("Client", "A SOAP Envelope element cannot have non Namespace qualified attributes");
} else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
if (*version == SOAP_1_2) {
- soap_server_fault_en("Client", "encodingStyle cannot be specified on the Envelope", NULL, NULL, NULL);
+ soap_server_fault_en("Client", "encodingStyle cannot be specified on the Envelope");
} else if (strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
- soap_server_fault_en("Client", "Unknown data encoding style", NULL, NULL, NULL);
+ soap_server_fault_en("Client", "Unknown data encoding style");
}
}
attr = attr->next;
@@ -3276,26 +3278,26 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
trav = trav->next;
}
if (body == NULL) {
- soap_server_fault_en("Client", "Body must be present in a SOAP envelope", NULL, NULL, NULL);
+ soap_server_fault_en("Client", "Body must be present in a SOAP envelope");
}
attr = body->properties;
while (attr != NULL) {
if (attr->ns == NULL) {
if (*version == SOAP_1_2) {
- soap_server_fault_en("Client", "A SOAP Body element cannot have non Namespace qualified attributes", NULL, NULL, NULL);
+ soap_server_fault_en("Client", "A SOAP Body element cannot have non Namespace qualified attributes");
}
} else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
if (*version == SOAP_1_2) {
- soap_server_fault_en("Client", "encodingStyle cannot be specified on the Body", NULL, NULL, NULL);
+ soap_server_fault_en("Client", "encodingStyle cannot be specified on the Body");
} else if (strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
- soap_server_fault_en("Client", "Unknown data encoding style", NULL, NULL, NULL);
+ soap_server_fault_en("Client", "Unknown data encoding style");
}
}
attr = attr->next;
}
if (trav != NULL && *version == SOAP_1_2) {
- soap_server_fault_en("Client", "A SOAP 1.2 envelope can contain only Header and Body", NULL, NULL, NULL);
+ soap_server_fault_en("Client", "A SOAP 1.2 envelope can contain only Header and Body");
}
func = NULL;
@@ -3304,7 +3306,7 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
if (trav->type == XML_ELEMENT_NODE) {
/*
if (func != NULL) {
- soap_server_fault_en("Client", "looks like we got \"Body\" with several functions call", NULL, NULL, NULL);
+ soap_server_fault_en("Client", "looks like we got \"Body\" with several functions call");
}
*/
func = trav;
@@ -3321,19 +3323,19 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
if (function) {
ZVAL_STRING(function_name, (char *)function->functionName);
} else {
- soap_server_fault_en("Client", "looks like we got \"Body\" without function call", NULL, NULL, NULL);
+ soap_server_fault_en("Client", "looks like we got \"Body\" without function call");
}
}
} else {
if (*version == SOAP_1_1) {
attr = get_attribute_ex(func->properties,"encodingStyle",SOAP_1_1_ENV_NAMESPACE);
if (attr && strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
- soap_server_fault_en("Client","Unknown Data Encoding Style", NULL, NULL, NULL);
+ soap_server_fault_en("Client","Unknown Data Encoding Style");
}
} else {
attr = get_attribute_ex(func->properties,"encodingStyle",SOAP_1_2_ENV_NAMESPACE);
if (attr && strcmp((char*)attr->children->content,SOAP_1_2_ENC_NAMESPACE) != 0) {
- soap_server_fault_en("DataEncodingUnknown","Unknown Data Encoding Style", NULL, NULL, NULL);
+ soap_server_fault_en("DataEncodingUnknown","Unknown Data Encoding Style");
}
}
if (!function) {
@@ -3341,7 +3343,7 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
}
if (sdl != NULL && function == NULL) {
if (*version == SOAP_1_2) {
- soap_server_fault_en("rpc:ProcedureNotPresent","Procedure not present", NULL, NULL, NULL);
+ soap_server_fault_en("rpc:ProcedureNotPresent","Procedure not present");
} else {
php_error(E_ERROR, "Procedure '%s' not present", func->name);
}
@@ -3355,12 +3357,12 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
attr = head->properties;
while (attr != NULL) {
if (attr->ns == NULL) {
- soap_server_fault_en("Client", "A SOAP Header element cannot have non Namespace qualified attributes", NULL, NULL, NULL);
+ soap_server_fault_en("Client", "A SOAP Header element cannot have non Namespace qualified attributes");
} else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
if (*version == SOAP_1_2) {
- soap_server_fault_en("Client", "encodingStyle cannot be specified on the Header", NULL, NULL, NULL);
+ soap_server_fault_en("Client", "encodingStyle cannot be specified on the Header");
} else if (strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
- soap_server_fault_en("Client", "Unknown data encoding style", NULL, NULL, NULL);
+ soap_server_fault_en("Client", "Unknown data encoding style");
}
}
attr = attr->next;
@@ -3374,7 +3376,7 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
if (*version == SOAP_1_1) {
attr = get_attribute_ex(hdr_func->properties,"encodingStyle",SOAP_1_1_ENV_NAMESPACE);
if (attr && strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
- soap_server_fault_en("Client","Unknown Data Encoding Style", NULL, NULL, NULL);
+ soap_server_fault_en("Client","Unknown Data Encoding Style");
}
attr = get_attribute_ex(hdr_func->properties,"actor",envelope_ns);
if (attr != NULL) {
@@ -3386,7 +3388,7 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
} else if (*version == SOAP_1_2) {
attr = get_attribute_ex(hdr_func->properties,"encodingStyle",SOAP_1_2_ENV_NAMESPACE);
if (attr && strcmp((char*)attr->children->content,SOAP_1_2_ENC_NAMESPACE) != 0) {
- soap_server_fault_en("DataEncodingUnknown","Unknown Data Encoding Style", NULL, NULL, NULL);
+ soap_server_fault_en("DataEncodingUnknown","Unknown Data Encoding Style");
}
attr = get_attribute_ex(hdr_func->properties,"role",envelope_ns);
if (attr != NULL) {
@@ -3406,7 +3408,7 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
strcmp((char*)attr->children->content,"false") == 0) {
mustUnderstand = 0;
} else {
- soap_server_fault_en("Client","mustUnderstand value is not boolean", NULL, NULL, NULL);
+ soap_server_fault_en("Client","mustUnderstand value is not boolean");
}
}
h = emalloc(sizeof(soapHeader));
@@ -3635,7 +3637,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, const char *fu
ns = xmlNewNs(envelope, BAD_CAST(SOAP_1_2_ENV_NAMESPACE), BAD_CAST(SOAP_1_2_ENV_NS_PREFIX));
xmlSetNs(envelope,ns);
} else {
- soap_server_fault_en("Server", "Unknown SOAP version", NULL, NULL, NULL);
+ soap_server_fault_en("Server", "Unknown SOAP version");
}
xmlDocSetRootElement(doc, envelope);