X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=debugger%2Faction.php;h=3e22c692ad1085c680fadf78eeb50518e22e43c8;hb=e1923b6d55b69e592b2fba8ce0f097751416823e;hp=0345798e716b35e39864b8ea39a354fa5ff9116d;hpb=da824472c0045c183f40792b8c760c11d024005d;p=plcapi.git diff --git a/debugger/action.php b/debugger/action.php index 0345798..3e22c69 100644 --- a/debugger/action.php +++ b/debugger/action.php @@ -8,6 +8,9 @@ * @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'); + ?> @@ -104,11 +107,11 @@ if ($action) { if (!class_exists('jsonrpc_client')) { die('Error: to debug the jsonrpc protocol the jsonrpc.inc file is needed'); } - $clientClass = 'PhpJsRpc\client'; - $requestClass = 'PhpJsRpc\request'; + $clientClass = 'PhpJsRpc\Client'; + $requestClass = 'PhpJsRpc\Request'; $protoName = 'JSONRPC'; } else { - $clientClass = 'PhpXmlRpc\client'; + $clientClass = 'PhpXmlRpc\Client'; $requestClass = 'PhpXmlRpc\Request'; $protoName = 'XMLRPC'; } @@ -239,7 +242,7 @@ if ($action) { // Before calling execute, echo out brief description of action taken + date and time ??? // this gives good user feedback for long-running methods... - echo '

' . htmlspecialchars($actionname) . ' on server ' . htmlspecialchars($server) . " ...

\n"; + echo '

' . htmlspecialchars($actionname, ENT_COMPAT, $inputcharset) . ' on server ' . htmlspecialchars($server, ENT_COMPAT, $inputcharset) . " ...

\n"; flush(); $response = null; @@ -265,14 +268,14 @@ if ($action) { if ($response) { if ($response->faultCode()) { // call failed! echo out error msg! - //echo '

'.htmlspecialchars($actionname).' on server '.htmlspecialchars($server).'

'; + //echo '

'.htmlspecialchars($actionname, ENT_COMPAT, $inputcharset).' on server '.htmlspecialchars($server, ENT_COMPAT, $inputcharset).'

'; echo "

$protoName call FAILED!

\n"; - echo "

Fault code: [" . htmlspecialchars($response->faultCode()) . - "] Reason: '" . htmlspecialchars($response->faultString()) . "'

\n"; + echo "

Fault code: [" . htmlspecialchars($response->faultCode(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . + "] Reason: '" . htmlspecialchars($response->faultString(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "'

\n"; echo(strftime("%d/%b/%Y:%H:%M:%S\n")); } else { // call succeeded: parse results - //echo '

'.htmlspecialchars($actionname).' on server '.htmlspecialchars($server).'

'; + //echo '

'.htmlspecialchars($actionname, ENT_COMPAT, $inputcharset).' on server '.htmlspecialchars($server, ENT_COMPAT, $inputcharset).'

'; printf("

%s call(s) OK (%.2f secs.)

\n", $protoName, $time); echo(strftime("%d/%b/%Y:%H:%M:%S\n")); @@ -291,27 +294,27 @@ if ($action) { } else { $class = ' class="evenrow"'; } - echo("" . htmlspecialchars($rec->scalarval()) . "
" . - "" . - "" . - "" . - "" . + echo("" . htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "" . + "" . + "" . + "" . + "" . "" . - "" . - "" . + "" . + "" . "" . "" . "" . - "" . - "" . - "" . - "" . + "" . + "" . + "" . + "" . "" . "" . - "" . + "" . "" . - "" . - "scalarval() . "\" />" . + "" . + "scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "\" />" . "" . "" . "" . @@ -341,8 +344,8 @@ if ($action) { $r2 = $resp[1]->value(); echo "\n"; - echo "\n\n\n\n"; - $desc = htmlspecialchars($r1->scalarval()); + echo "\n\n\n\n"; + $desc = htmlspecialchars($r1->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding); if ($desc == "") { $desc = "-"; } @@ -362,13 +365,16 @@ if ($action) { $x = $r2->arraymem($i); if ($x->kindOf() == "array") { $ret = $x->arraymem(0); - echo "OUT: " . htmlspecialchars($ret->scalarval()) . "
IN: ("; + echo "OUT: " . htmlspecialchars($ret->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "
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 . '<' . htmlspecialchars($y->scalarval()) . '>scalarval()) . ">\n"; + $payload = $payload . '<' . + htmlspecialchars($y->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . + '>scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . + ">\n"; } $alt_payload .= $y->scalarval(); if ($k < $x->arraysize() - 1) { @@ -385,28 +391,28 @@ if ($action) { // button to test this method //$payload="\n$method\n\n$payload\n"; echo "" . - "" . - "" . - "" . - "" . + "" . + "" . + "" . + "" . "" . - "" . - "" . + "" . + "" . "" . "" . "" . - "" . - "" . - "" . - "" . + "" . + "" . + "" . + "" . "" . "" . - "" . + "" . "" . - "" . - "" . - "" . - "" . + "" . + "" . + "" . + "" . "" . ""; if ($wstype != 1) { @@ -415,29 +421,29 @@ if ($action) { echo "\n"; echo "
" . - "" . - "" . - "" . - "" . + "" . + "" . + "" . + "" . "" . - "" . - "" . + "" . + "" . "" . "" . "" . - "" . - "" . - "" . - "" . + "" . + "" . + "" . + "" . "" . "" . - "" . + "" . "" . - "" . - "" . + "" . + "" . "" . - "" . - "" . + "" . + "" . "" . "" . "" . @@ -526,6 +532,7 @@ if ($action) {

Changelog

    +
  • 2015-04-19: fix problems with LATIN-1 characters in payload
  • 2007-02-20: add visual editor for method payload; allow strings, bools as jsonrpc msg id
  • 2006-06-26: support building php code stub for calling remote methods
  • 2006-05-25: better support for long running queries; check for no-curl installs
Method" . htmlspecialchars($method) . "  
Method" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "