summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/xmlrpc/tests/001.phpt15
-rw-r--r--ext/xmlrpc/tests/002.phpt9
-rw-r--r--ext/xmlrpc/tests/bug42189.phpt2
-rw-r--r--ext/xmlrpc/xmlrpc-epi-php.c22
4 files changed, 17 insertions, 31 deletions
diff --git a/ext/xmlrpc/tests/001.phpt b/ext/xmlrpc/tests/001.phpt
index 99fd958d29..2625096714 100644
--- a/ext/xmlrpc/tests/001.phpt
+++ b/ext/xmlrpc/tests/001.phpt
@@ -38,19 +38,8 @@ string(160) "<?xml version="1.0" encoding="iso-8859-1"?>
</methodCall>
"
-Notice: Array to string conversion in %s on line %d
-string(177) "<?xml version="1.0" encoding="iso-8859-1"?>
-<methodCall>
-<methodName>Array</methodName>
-<params>
- <param>
- <value>
- <int>1</int>
- </value>
- </param>
-</params>
-</methodCall>
-"
+Warning: xmlrpc_encode_request() expects parameter 1 to be string, array given in %s on line %d
+NULL
string(175) "<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>3.4</methodName>
diff --git a/ext/xmlrpc/tests/002.phpt b/ext/xmlrpc/tests/002.phpt
index c8d722b808..83586464bc 100644
--- a/ext/xmlrpc/tests/002.phpt
+++ b/ext/xmlrpc/tests/002.phpt
@@ -47,10 +47,7 @@ array(1) {
}
string(2) "-1"
-Notice: Array to string conversion in %s on line %d
-array(1) {
- [0]=>
- int(1)
-}
-string(5) "Array"
+Warning: xmlrpc_encode_request() expects parameter 1 to be string, array given in %s on line %d
+NULL
+string(2) "-1"
Done
diff --git a/ext/xmlrpc/tests/bug42189.phpt b/ext/xmlrpc/tests/bug42189.phpt
index 2b4e47ade7..55e726cf68 100644
--- a/ext/xmlrpc/tests/bug42189.phpt
+++ b/ext/xmlrpc/tests/bug42189.phpt
@@ -11,5 +11,5 @@ var_dump($ok);
echo "Done\n";
?>
--EXPECT--
-bool(true)
+bool(false)
Done
diff --git a/ext/xmlrpc/xmlrpc-epi-php.c b/ext/xmlrpc/xmlrpc-epi-php.c
index b9efd8baf0..533b06aaee 100644
--- a/ext/xmlrpc/xmlrpc-epi-php.c
+++ b/ext/xmlrpc/xmlrpc-epi-php.c
@@ -682,10 +682,12 @@ PHP_FUNCTION(xmlrpc_encode_request)
{
XMLRPC_REQUEST xRequest = NULL;
char *outBuf;
- zval **method, **vals, *out_opts = NULL;
+ zval *vals, *out_opts = NULL;
+ char *method = NULL;
+ int method_len;
php_output_options out;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZ|a", &method, &vals, &out_opts) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!z|a", &method, &method_len, &vals, &out_opts) == FAILURE) {
return;
}
@@ -696,15 +698,14 @@ PHP_FUNCTION(xmlrpc_encode_request)
if (xRequest) {
XMLRPC_RequestSetOutputOptions(xRequest, &out.xmlrpc_out);
- if (Z_TYPE_PP(method) == IS_NULL) {
+ if (method == NULL) {
XMLRPC_RequestSetRequestType(xRequest, xmlrpc_request_response);
} else {
- convert_to_string_ex(method);
- XMLRPC_RequestSetMethodName(xRequest, Z_STRVAL_PP(method));
+ XMLRPC_RequestSetMethodName(xRequest, method);
XMLRPC_RequestSetRequestType(xRequest, xmlrpc_request_call);
}
- if (Z_TYPE_PP(vals) != IS_NULL) {
- XMLRPC_RequestSetData(xRequest, PHP_to_XMLRPC(*vals TSRMLS_CC));
+ if (Z_TYPE_P(vals) != IS_NULL) {
+ XMLRPC_RequestSetData(xRequest, PHP_to_XMLRPC(vals TSRMLS_CC));
}
outBuf = XMLRPC_REQUEST_ToXML(xRequest, 0);
@@ -794,7 +795,6 @@ PHP_FUNCTION(xmlrpc_decode_request)
return;
}
- convert_to_string_ex(method);
if (return_value_used) {
zval* retval = decode_request_worker(xml, xml_len, encoding_len ? encoding : NULL, *method);
@@ -1055,20 +1055,20 @@ PHP_FUNCTION(xmlrpc_server_call_method)
XMLRPC_REQUEST xRequest;
STRUCT_XMLRPC_REQUEST_INPUT_OPTIONS input_opts;
xmlrpc_server_data* server;
- zval **caller_params, *handle, **output_opts = NULL;
+ zval **caller_params, *handle, *output_opts = NULL;
char *rawxml;
int rawxml_len, type;
php_output_options out;
int argc =ZEND_NUM_ARGS();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsZ|Z", &handle, &rawxml, &rawxml_len, &caller_params, &output_opts) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsZ|a", &handle, &rawxml, &rawxml_len, &caller_params, &output_opts) != SUCCESS) {
return;
}
/* user output options */
if (argc == 3) {
set_output_options(&out, NULL);
} else {
- set_output_options(&out, *output_opts);
+ set_output_options(&out, output_opts);
}
server = zend_list_find(Z_LVAL_P(handle), &type);