<?php
/**
* @author Gaetano Giunta
- * @copyright (C) 2005-2014 G. Giunta
- * @license code licensed under the BSD License: http://phpxmlrpc.sourceforge.net/license.txt
+ * @copyright (C) 2005-2015 G. Giunta
+ * @license code licensed under the BSD License: see file license.txt
*
* @todo switch params for http compression from 0,1,2 to values to be used directly
* @todo use ob_start to catch debug info and echo it AFTER method call results?
* @todo be smarter in creating client stub for proxy/auth cases: only set appropriate property of client obj
**/
+
+header('Content-Type: text/html; charset=utf-8');
+
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
include __DIR__ . '/common.php';
if ($action) {
+ include_once __DIR__ . "/../src/Autoloader.php";
+ PhpXmlRpc\Autoloader::register();
+
// make sure the script waits long enough for the call to complete...
if ($timeout) {
set_time_limit($timeout + 10);
}
- include 'xmlrpc.inc';
if ($wstype == 1) {
@include 'jsonrpc.inc';
if (!class_exists('jsonrpc_client')) {
die('Error: to debug the jsonrpc protocol the jsonrpc.inc file is needed');
}
- $clientclass = 'jsonrpc_client';
- $msgclass = 'jsonrpcmsg';
- $protoname = 'JSONRPC';
+ $clientClass = 'PhpJsRpc\Client';
+ $requestClass = 'PhpJsRpc\Request';
+ $protoName = 'JSONRPC';
} else {
- $clientclass = 'xmlrpc_client';
- $msgclass = 'xmlrpcmsg';
- $protoname = 'XMLRPC';
+ $clientClass = 'PhpXmlRpc\Client';
+ $requestClass = 'PhpXmlRpc\Request';
+ $protoName = 'XMLRPC';
}
if ($port != "") {
- $client = new $clientclass($path, $host, $port);
+ $client = new $clientClass($path, $host, $port);
$server = "$host:$port$path";
} else {
- $client = new $clientclass($path, $host);
+ $client = new $clientClass($path, $host);
$server = "$host$path";
}
if ($protocol == 2) {
$msg = array();
switch ($action) {
-
- case 'wrap':
- @include 'xmlrpc_wrappers.inc';
- if (!function_exists('build_remote_method_wrapper_code')) {
- die('Error: to enable creation of method stubs the xmlrpc_wrappers.inc file is needed');
- }
// fall thru intentionally
case 'describe':
case 'wrap':
- $msg[0] = new $msgclass('system.methodHelp', array(), $id);
- $msg[0]->addparam(new xmlrpcval($method));
- $msg[1] = new $msgclass('system.methodSignature', array(), $id + 1);
- $msg[1]->addparam(new xmlrpcval($method));
+ $msg[0] = new $requestClass('system.methodHelp', array(), $id);
+ $msg[0]->addparam(new PhpXmlRpc\Value($method));
+ $msg[1] = new $requestClass('system.methodSignature', array(), $id + 1);
+ $msg[1]->addparam(new PhpXmlRpc\Value($method));
$actionname = 'Description of method "' . $method . '"';
break;
case 'list':
- $msg[0] = new $msgclass('system.listMethods', array(), $id);
+ $msg[0] = new $requestClass('system.listMethods', array(), $id);
$actionname = 'List of available methods';
break;
case 'execute':
if (!payload_is_safe($payload)) {
die("Tsk tsk tsk, please stop it or I will have to call in the cops!");
}
- $msg[0] = new $msgclass($method, array(), $id);
+ $msg[0] = new $requestClass($method, array(), $id);
// hack! build xml payload by hand
if ($wstype == 1) {
$msg[0]->payload = "{\n" .
}
}
} else {
- $msg[0]->payload = $msg[0]->xml_header() .
+ $msg[0]->payload = $msg[0]->xml_header($inputcharset) .
'<methodName>' . $method . "</methodName>\n<params>" .
$payload .
"</params>\n" . $msg[0]->xml_footer();
// Before calling execute, echo out brief description of action taken + date and time ???
// this gives good user feedback for long-running methods...
- echo '<h2>' . htmlspecialchars($actionname) . ' on server ' . htmlspecialchars($server) . " ...</h2>\n";
+ echo '<h2>' . htmlspecialchars($actionname, ENT_COMPAT, $inputcharset) . ' on server ' . htmlspecialchars($server, ENT_COMPAT, $inputcharset) . " ...</h2>\n";
flush();
$response = null;
echo '<div class="dbginfo"><h2>Debug info:</h2>';
} /// @todo use ob_start instead
$resp = array();
- $mtime = explode(' ', microtime());
- $time = (float)$mtime[0] + (float)$mtime[1];
+ $time = microtime(true);
foreach ($msg as $message) {
// catch errors: for older xmlrpc libs, send does not return by ref
- @$response = &$client->send($message, $timeout, $httpprotocol);
+ @$response = $client->send($message, $timeout, $httpprotocol);
$resp[] = $response;
if (!$response || $response->faultCode()) {
break;
}
}
- $mtime = explode(' ', microtime());
- $time = (float)$mtime[0] + (float)$mtime[1] - $time;
+ $time = microtime(true) - $time;
if ($debug) {
echo "</div>\n";
}
if ($response) {
if ($response->faultCode()) {
// call failed! echo out error msg!
- //echo '<h2>'.htmlspecialchars($actionname).' on server '.htmlspecialchars($server).'</h2>';
- echo "<h3>$protoname call FAILED!</h3>\n";
- echo "<p>Fault code: [" . htmlspecialchars($response->faultCode()) .
- "] Reason: '" . htmlspecialchars($response->faultString()) . "'</p>\n";
+ //echo '<h2>'.htmlspecialchars($actionname, ENT_COMPAT, $inputcharset).' on server '.htmlspecialchars($server, ENT_COMPAT, $inputcharset).'</h2>';
+ echo "<h3>$protoName call FAILED!</h3>\n";
+ echo "<p>Fault code: [" . htmlspecialchars($response->faultCode(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) .
+ "] Reason: '" . htmlspecialchars($response->faultString(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "'</p>\n";
echo(strftime("%d/%b/%Y:%H:%M:%S\n"));
} else {
// call succeeded: parse results
- //echo '<h2>'.htmlspecialchars($actionname).' on server '.htmlspecialchars($server).'</h2>';
- printf("<h3>%s call(s) OK (%.2f secs.)</h3>\n", $protoname, $time);
+ //echo '<h2>'.htmlspecialchars($actionname, ENT_COMPAT, $inputcharset).' on server '.htmlspecialchars($server, ENT_COMPAT, $inputcharset).'</h2>';
+ printf("<h3>%s call(s) OK (%.2f secs.)</h3>\n", $protoName, $time);
echo(strftime("%d/%b/%Y:%H:%M:%S\n"));
switch ($action) {
} else {
$class = ' class="evenrow"';
}
- echo("<tr><td$class>" . htmlspecialchars($rec->scalarval()) . "</td><td$class><form action=\"controller.php\" method=\"get\" target=\"frmcontroller\">" .
- "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host) . "\" />" .
- "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port) . "\" />" .
- "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path) . "\" />" .
- "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id) . "\" />" .
+ echo("<tr><td$class>" . htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "</td><td$class><form action=\"controller.php\" method=\"get\" target=\"frmcontroller\">" .
+ "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" .
+ "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" .
+ "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" .
+ "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" .
"<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" .
- "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username) . "\" />" .
- "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password) . "\" />" .
+ "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" .
+ "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" .
"<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" .
"<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" .
"<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" .
- "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo) . "\" />" .
- "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy) . "\" />" .
- "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser) . "\" />" .
- "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd) . "\" />" .
+ "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" .
+ "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" .
+ "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" .
+ "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" .
"<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" .
"<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" .
- "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies) . "\" />" .
+ "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" .
"<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" .
- "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout) . "\" />" .
- "<input type=\"hidden\" name=\"method\" value=\"" . $rec->scalarval() . "\" />" .
+ "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" .
+ "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "\" />" .
"<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" .
"<input type=\"hidden\" name=\"action\" value=\"describe\" />" .
"<input type=\"hidden\" name=\"run\" value=\"now\" />" .
"<input type=\"submit\" value=\"Describe\" /></form></td>");
//echo("</tr>\n");
- // generate lo scheletro per il method payload per eventuali test
+ // generate the skeleton for method payload per possible tests
//$methodpayload="<methodCall>\n<methodName>".$rec->scalarval()."</methodName>\n<params>\n<param><value></value></param>\n</params>\n</methodCall>";
/*echo ("<form action=\"{$_SERVER['PHP_SELF']}\" method=\"get\"><td>".
$r2 = $resp[1]->value();
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
- echo "<thead>\n<tr><th>Method</th><th>" . htmlspecialchars($method) . "</th><th> </th><th> </th></tr>\n</thead>\n<tbody>\n";
- $desc = htmlspecialchars($r1->scalarval());
+ echo "<thead>\n<tr><th>Method</th><th>" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "</th><th> </th><th> </th></tr>\n</thead>\n<tbody>\n";
+ $desc = htmlspecialchars($r1->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding);
if ($desc == "") {
$desc = "-";
}
$x = $r2->arraymem($i);
if ($x->kindOf() == "array") {
$ret = $x->arraymem(0);
- echo "<code>OUT: " . htmlspecialchars($ret->scalarval()) . "<br />IN: (";
+ echo "<code>OUT: " . htmlspecialchars($ret->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "<br />IN: (";
if ($x->arraysize() > 1) {
for ($k = 1; $k < $x->arraysize(); $k++) {
$y = $x->arraymem($k);
- echo $y->scalarval();
+ echo htmlspecialchars($y->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding);
if ($wstype != 1) {
- $payload = $payload . '<param><value><' . htmlspecialchars($y->scalarval()) . '></' . htmlspecialchars($y->scalarval()) . "></value></param>\n";
+ $payload = $payload . '<param><value><' .
+ htmlspecialchars($y->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) .
+ '></' . htmlspecialchars($y->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) .
+ "></value></param>\n";
}
$alt_payload .= $y->scalarval();
if ($k < $x->arraysize() - 1) {
echo 'Unknown';
}
echo '</td>';
- //bottone per testare questo metodo
+ // button to test this method
//$payload="<methodCall>\n<methodName>$method</methodName>\n<params>\n$payload</params>\n</methodCall>";
echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">" .
- "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host) . "\" />" .
- "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port) . "\" />" .
- "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path) . "\" />" .
- "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id) . "\" />" .
+ "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" .
+ "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" .
+ "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" .
+ "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" .
"<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" .
- "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username) . "\" />" .
- "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password) . "\" />" .
+ "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" .
+ "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" .
"<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" .
"<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" .
"<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" .
- "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo) . "\" />" .
- "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy) . "\" />" .
- "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser) . "\" />" .
- "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd) . "\" />" .
+ "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" .
+ "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" .
+ "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" .
+ "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" .
"<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" .
"<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" .
- "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies) . "\" />" .
+ "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" .
"<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" .
- "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout) . "\" />" .
- "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($method) . "\" />" .
- "<input type=\"hidden\" name=\"methodpayload\" value=\"" . htmlspecialchars($payload) . "\" />" .
- "<input type=\"hidden\" name=\"altmethodpayload\" value=\"" . htmlspecialchars($alt_payload) . "\" />" .
+ "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" .
+ "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "\" />" .
+ "<input type=\"hidden\" name=\"methodpayload\" value=\"" . htmlspecialchars($payload, ENT_COMPAT, $inputcharset) . "\" />" .
+ "<input type=\"hidden\" name=\"altmethodpayload\" value=\"" . htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset) . "\" />" .
"<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" .
"<input type=\"hidden\" name=\"action\" value=\"execute\" />";
if ($wstype != 1) {
echo "</form></td>\n";
echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">" .
- "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host) . "\" />" .
- "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port) . "\" />" .
- "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path) . "\" />" .
- "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id) . "\" />" .
+ "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" .
+ "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" .
+ "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" .
+ "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" .
"<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" .
- "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username) . "\" />" .
- "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password) . "\" />" .
+ "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" .
+ "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" .
"<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" .
"<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" .
"<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" .
- "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo) . "\" />" .
- "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy) . "\" />" .
- "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser) . "\" />" .
- "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd) . "\" />" .
+ "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" .
+ "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" .
+ "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" .
+ "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" .
"<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" .
"<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" .
- "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies) . "\" />" .
+ "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" .
"<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" .
- "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout) . "\" />" .
- "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($method) . "\" />" .
+ "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" .
+ "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "\" />" .
"<input type=\"hidden\" name=\"methodsig\" value=\"" . $i . "\" />" .
- "<input type=\"hidden\" name=\"methodpayload\" value=\"" . htmlspecialchars($payload) . "\" />" .
- "<input type=\"hidden\" name=\"altmethodpayload\" value=\"" . htmlspecialchars($alt_payload) . "\" />" .
+ "<input type=\"hidden\" name=\"methodpayload\" value=\"" . htmlspecialchars($payload, ENT_COMPAT, $inputcharset) . "\" />" .
+ "<input type=\"hidden\" name=\"altmethodpayload\" value=\"" . htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset) . "\" />" .
"<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" .
"<input type=\"hidden\" name=\"run\" value=\"now\" />" .
"<input type=\"hidden\" name=\"action\" value=\"wrap\" />" .
echo "Error: signature unknown\n";
} else {
$mdesc = $r1->scalarval();
- $msig = php_xmlrpc_decode($r2);
+ $encoder = new PhpXmlRpc\Encoder();
+ $msig = $encoder->decode($r2);
$msig = $msig[$methodsig];
$proto = $protocol == 2 ? 'https' : $protocol == 1 ? 'http11' : '';
if ($proxy == '' && $username == '' && !$requestcompression && !$responsecompression &&
$prefix = 'xmlrpc';
}
//$code = wrap_xmlrpc_method($client, $method, $methodsig, 0, $proto, '', $opts);
- $code = build_remote_method_wrapper_code($client, $method, str_replace('.', '_', $prefix . '_' . $method), $msig, $mdesc, $timeout, $proto, $opts, $prefix);
+ $wrapper = new PhpXmlRpc\Wrapper();
+ $code = $wrapper->build_remote_method_wrapper_code($client, $method, str_replace('.', '_', $prefix . '_' . $method), $msig, $mdesc, $timeout, $proto, $opts, $prefix);
//if ($code)
//{
echo "<div id=\"phpcode\">\n";
// no action taken yet: give some instructions on debugger usage
?>
- <h3>Instructions on usage of the debugger:</h3>
+ <h3>Instructions on usage of the debugger</h3>
<ol>
<li>Run a 'list available methods' action against desired server</li>
<li>If list of methods appears, click on 'describe method' for desired method</li>
}
?>
- <h3>Example:</h3>
+ <h3>Example</h3>
<p>
Server Address: phpxmlrpc.sourceforge.net<br/>
Path: /server.php
</p>
- <h3>Notice:</h3>
+ <h3>Notice</h3>
<p>all usernames and passwords entered on the above form will be written to the web server logs of this server. Use
with care.</p>
<h3>Changelog</h3>
<ul>
+ <li>2015-04-19: fix problems with LATIN-1 characters in payload</li>
<li>2007-02-20: add visual editor for method payload; allow strings, bools as jsonrpc msg id</li>
<li>2006-06-26: support building php code stub for calling remote methods</li>
<li>2006-05-25: better support for long running queries; check for no-curl installs</li>