@@ -1276,19 +1276,25 @@ discard block |
||
1276 | 1276 | $this->errstr = 'no response'; |
1277 | 1277 | $resp = new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['curl_fail'], PhpXmlRpc::$xmlrpcstr['curl_fail'] . |
1278 | 1278 | ': ' . curl_error($curl)); |
1279 | - if (PHP_MAJOR_VERSION < 8) curl_close($curl); |
|
1279 | + if (PHP_MAJOR_VERSION < 8) { |
|
1280 | + curl_close($curl); |
|
1281 | + } |
|
1280 | 1282 | if ($opts['keepalive']) { |
1281 | 1283 | $this->xmlrpc_curl_handle = null; |
1282 | 1284 | } |
1283 | 1285 | } else { |
1284 | 1286 | if (!$opts['keepalive']) { |
1285 | - if (PHP_MAJOR_VERSION < 8) curl_close($curl); |
|
1287 | + if (PHP_MAJOR_VERSION < 8) { |
|
1288 | + curl_close($curl); |
|
1289 | + } |
|
1286 | 1290 | } |
1287 | 1291 | $resp = $req->parseResponse($result, true, $opts['return_type']); |
1288 | 1292 | if ($opts['keepalive']) { |
1289 | 1293 | /// @todo if we got back a 302 or 308, we should not reuse the curl handle for later calls |
1290 | 1294 | if (is_object($resp) && $resp->faultCode() == PhpXmlRpc::$xmlrpcerr['http_error']) { |
1291 | - if (PHP_MAJOR_VERSION < 8) curl_close($curl); |
|
1295 | + if (PHP_MAJOR_VERSION < 8) { |
|
1296 | + curl_close($curl); |
|
1297 | + } |
|
1292 | 1298 | $this->xmlrpc_curl_handle = null; |
1293 | 1299 | } |
1294 | 1300 | } |
@@ -1447,7 +1453,9 @@ discard block |
||
1447 | 1453 | curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE); |
1448 | 1454 | } else { |
1449 | 1455 | $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': warning. HTTP2 is not supported by the current PHP/curl install'); |
1450 | - if (PHP_MAJOR_VERSION < 8) curl_close($curl); |
|
1456 | + if (PHP_MAJOR_VERSION < 8) { |
|
1457 | + curl_close($curl); |
|
1458 | + } |
|
1451 | 1459 | return false; |
1452 | 1460 | } |
1453 | 1461 | break; |
@@ -1462,7 +1470,9 @@ discard block |
||
1462 | 1470 | curl_setopt($curl, CURLOPT_HTTPAUTH, $opts['authtype']); |
1463 | 1471 | } elseif ($opts['authtype'] != 1) { |
1464 | 1472 | $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth is supported by the current PHP/curl install'); |
1465 | - if (PHP_MAJOR_VERSION < 8) curl_close($curl); |
|
1473 | + if (PHP_MAJOR_VERSION < 8) { |
|
1474 | + curl_close($curl); |
|
1475 | + } |
|
1466 | 1476 | return false; |
1467 | 1477 | } |
1468 | 1478 | } |
@@ -1513,7 +1523,9 @@ discard block |
||
1513 | 1523 | curl_setopt($curl, CURLOPT_PROXYAUTH, $opts['proxy_authtype']); |
1514 | 1524 | } elseif ($opts['proxy_authtype'] != 1) { |
1515 | 1525 | $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth to proxy is supported by the current PHP/curl install'); |
1516 | - if (PHP_MAJOR_VERSION < 8) curl_close($curl); |
|
1526 | + if (PHP_MAJOR_VERSION < 8) { |
|
1527 | + curl_close($curl); |
|
1528 | + } |
|
1517 | 1529 | return false; |
1518 | 1530 | } |
1519 | 1531 | } |
@@ -71,7 +71,12 @@ discard block |
||
71 | 71 | <html lang="en"> |
72 | 72 | <head> |
73 | 73 | <link rel="icon" type="image/vnd.microsoft.icon" href="favicon.ico"> |
74 | - <title><?php if (defined('DEFAULT_WSTYPE') && (DEFAULT_WSTYPE == 1 || DEFAULT_WSTYPE == 2)) echo 'JSON-RPC'; else echo 'XML-RPC'; ?> Debugger</title> |
|
74 | + <title><?php if (defined('DEFAULT_WSTYPE') && (DEFAULT_WSTYPE == 1 || DEFAULT_WSTYPE == 2)) { |
|
75 | + echo 'JSON-RPC'; |
|
76 | +} else { |
|
77 | + echo 'XML-RPC'; |
|
78 | +} |
|
79 | +?> Debugger</title> |
|
75 | 80 | <meta name="robots" content="index,nofollow"/> |
76 | 81 | <script type="text/javascript" language="Javascript"> |
77 | 82 | if (window.name != 'frmcontroller') |
@@ -308,8 +313,10 @@ discard block |
||
308 | 313 | </script> |
309 | 314 | </head> |
310 | 315 | <body |
311 | - onload="<?php if ($hasjsonrpcclient) echo "switchtransport($wstype); " ?>switchaction(); switchssl(); switchauth(); swicthcainfo();<?php if ($run) { |
|
316 | + onload="<?php if ($hasjsonrpcclient) { |
|
317 | + echo "switchtransport($wstype); " ?>switchaction(); switchssl(); switchauth(); swicthcainfo();<?php if ($run) { |
|
312 | 318 | echo ' document.frmaction.submit();'; |
319 | +} |
|
313 | 320 | } ?>"> |
314 | 321 | <h1>XML-RPC |
315 | 322 | <?php if ($hasjsonrpcclient) { |
@@ -322,7 +329,10 @@ discard block |
||
322 | 329 | echo ' / <form name="frmjsonrpc1" style="display: inline;" action="."><input name="yes" type="radio" onclick="switchtransport(1);"/></form>JSON-RPC 1.0 '; |
323 | 330 | } ?> |
324 | 331 | Debugger</h1><h3>(based on <a href="https://gggeek.github.io/phpxmlrpc/">PHPXMLRPC</a>, ver. <?php echo htmlspecialchars(\PhpXmlRpc\PhpXmlRpc::$xmlrpcVersion)?> |
325 | -<?php if (class_exists('\PhpXmlRpc\JsonRpc\PhpJsonRpc')) echo ' and <a href="https://gggeek.github.io/phpxmlrpc-jsonrpc/">PHPJOSNRPC</a>, ver. ' . htmlspecialchars(\PhpXmlRpc\JsonRpc\PhpJsonRpc::$jsonrpcVersion); ?>)</h3> |
|
332 | +<?php if (class_exists('\PhpXmlRpc\JsonRpc\PhpJsonRpc')) { |
|
333 | + echo ' and <a href="https://gggeek.github.io/phpxmlrpc-jsonrpc/">PHPJOSNRPC</a>, ver. ' . htmlspecialchars(\PhpXmlRpc\JsonRpc\PhpJsonRpc::$jsonrpcVersion); |
|
334 | +} |
|
335 | +?>)</h3> |
|
326 | 336 | <form name="frmaction" method="get" action="action.php" target="frmaction" onSubmit="switchFormMethod();"> |
327 | 337 | |
328 | 338 | <table id="serverblock"> |