summaryrefslogtreecommitdiff
path: root/ext/xmlrpc/tests
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2007-11-12 11:23:04 +0000
committerAntony Dovgal <tony2001@php.net>2007-11-12 11:23:04 +0000
commit1f1140a93a18cb242111e53cc0eff935763b7ea0 (patch)
tree537531950ae81138200f3f99db3c0cb58537dec8 /ext/xmlrpc/tests
parentdd3c04cea194b0a4518b0afeef2f148f8b2680cd (diff)
downloadphp-git-1f1140a93a18cb242111e53cc0eff935763b7ea0.tar.gz
MFH: fix #42736 (xmlrpc_server_call_method() crashes)
Diffstat (limited to 'ext/xmlrpc/tests')
-rw-r--r--ext/xmlrpc/tests/bug42736.phpt56
1 files changed, 56 insertions, 0 deletions
diff --git a/ext/xmlrpc/tests/bug42736.phpt b/ext/xmlrpc/tests/bug42736.phpt
new file mode 100644
index 0000000000..b9a46cff5c
--- /dev/null
+++ b/ext/xmlrpc/tests/bug42736.phpt
@@ -0,0 +1,56 @@
+--TEST--
+Bug #42736 (xmlrpc_server_call_method() crashes)
+--SKIPIF--
+<?php if (!extension_loaded("xmlrpc")) print "skip"; ?>
+--FILE--
+<?php
+
+class SOAP_Array {
+ public function get($id){
+ return $this->add($id);
+ }
+}
+
+$xml = xmlrpc_server_create();
+
+$Myrequest = '<?xml version="1.0" encoding="UTF-8"?><methodCall><methodName>GetProducts</methodName><params><param><value><dateTime.iso8601>20060922T14:26:19</dateTime.iso8601></value></param></params></methodCall>';
+
+class MyClass {
+ function GetProducts($dummy, $time){
+ return array('faultString' => $time);
+ }
+}
+$myclass = new MyClass();
+xmlrpc_server_register_method($xml, 'GetProducts', array($myclass, 'GetProducts'));
+$response = xmlrpc_server_call_method($xml, $Myrequest, null);
+
+var_dump($response);
+
+echo "Done\n";
+?>
+--EXPECTF--
+string(402) "<?xml version="1.0" encoding="iso-8859-1"?>
+<methodResponse>
+<params>
+ <param>
+ <value>
+ <struct>
+ <member>
+ <name>faultString</name>
+ <value>
+ <array>
+ <data>
+ <value>
+ <dateTime.iso8601>20060922T14:26:19</dateTime.iso8601>
+ </value>
+ </data>
+ </array>
+ </value>
+ </member>
+ </struct>
+ </value>
+ </param>
+</params>
+</methodResponse>
+"
+Done