@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | die(); |
22 | 22 | } |
23 | 23 | |
24 | -require_once __DIR__ . "/_prepend.php"; |
|
24 | +require_once __DIR__."/_prepend.php"; |
|
25 | 25 | |
26 | 26 | use PhpXmlRpc\PhpXmlRpc; |
27 | 27 | use PhpXmlRpc\Server; |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | } elseif ($_GET['FORCE_AUTH'] == 'Digest') { |
81 | 81 | if (empty($_SERVER['PHP_AUTH_DIGEST'])) { |
82 | 82 | header('HTTP/1.1 401 Unauthorized'); |
83 | - header('WWW-Authenticate: Digest realm="Phpxmlrpc Digest Realm",qop="auth",nonce="' . uniqid() . '",opaque="' . md5('Phpxmlrpc Digest Realm') . '"'); |
|
83 | + header('WWW-Authenticate: Digest realm="Phpxmlrpc Digest Realm",qop="auth",nonce="'.uniqid().'",opaque="'.md5('Phpxmlrpc Digest Realm').'"'); |
|
84 | 84 | die('Text visible if user hits Cancel button'); |
85 | 85 | } |
86 | 86 | } |
@@ -8,5 +8,5 @@ |
||
8 | 8 | } |
9 | 9 | |
10 | 10 | // Use the custom class autoloader. These two lines are not needed when the phpxmlrpc library is installed using Composer |
11 | -include_once __DIR__ . '/../../src/Autoloader.php'; |
|
11 | +include_once __DIR__.'/../../src/Autoloader.php'; |
|
12 | 12 | PhpXmlRpc\Autoloader::register(); |
@@ -8,7 +8,7 @@ |
||
8 | 8 | } |
9 | 9 | |
10 | 10 | // Use the custom class autoloader. These two lines are not needed when the phpxmlrpc library is installed using Composer |
11 | -include_once __DIR__ . '/../../src/Autoloader.php'; |
|
11 | +include_once __DIR__.'/../../src/Autoloader.php'; |
|
12 | 12 | PhpXmlRpc\Autoloader::register(); |
13 | 13 | |
14 | 14 | // Let unit tests run against localhost, 'plain' demos against a known public server |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | // Make sure we set the correct charset type for output, so that we can display all characters |
18 | 18 | header('Content-Type: text/html; charset=utf-8'); |
19 | 19 | |
20 | -include __DIR__ . '/common.php'; |
|
20 | +include __DIR__.'/common.php'; |
|
21 | 21 | if ($action == '') { |
22 | 22 | $action = 'list'; |
23 | 23 | } |
@@ -33,27 +33,27 @@ discard block |
||
33 | 33 | /// @const JSXMLRPC_PATH Path to the visual xmlrpc editing dialog's containing folder. Can be absolute, or |
34 | 34 | /// relative to this debugger's folder. |
35 | 35 | if (defined('JSXMLRPC_PATH')) { |
36 | - $editorpaths = array(JSXMLRPC_PATH[0] === '/' ? JSXMLRPC_PATH : (__DIR__ . '/' . JSXMLRPC_PATH)); |
|
36 | + $editorpaths = array(JSXMLRPC_PATH[0] === '/' ? JSXMLRPC_PATH : (__DIR__.'/'.JSXMLRPC_PATH)); |
|
37 | 37 | } else { |
38 | 38 | $editorpaths = array( |
39 | - __DIR__ . '/vendor/phpxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via composer in debugger |
|
40 | - __DIR__ . '/node_modules/@jsxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via npm in debugger |
|
41 | - __DIR__ . '/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via taskfile in debugger |
|
42 | - __DIR__ . '/../vendor/phpxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via composer |
|
43 | - __DIR__ . '/../node_modules/@jsxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via npm |
|
44 | - __DIR__ . '/../../jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc too |
|
45 | - __DIR__ . '/../../../../web/node_modules/@jsxmlrpc/jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc installed via npm |
|
39 | + __DIR__.'/vendor/phpxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via composer in debugger |
|
40 | + __DIR__.'/node_modules/@jsxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via npm in debugger |
|
41 | + __DIR__.'/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via taskfile in debugger |
|
42 | + __DIR__.'/../vendor/phpxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via composer |
|
43 | + __DIR__.'/../node_modules/@jsxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via npm |
|
44 | + __DIR__.'/../../jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc too |
|
45 | + __DIR__.'/../../../../web/node_modules/@jsxmlrpc/jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc installed via npm |
|
46 | 46 | ); |
47 | 47 | } |
48 | - foreach($editorpaths as $editorpath) { |
|
49 | - if (is_file(realpath($editorpath . 'visualeditor.html'))) { |
|
48 | + foreach ($editorpaths as $editorpath) { |
|
49 | + if (is_file(realpath($editorpath.'visualeditor.html'))) { |
|
50 | 50 | $haseditor = true; |
51 | 51 | break; |
52 | 52 | } |
53 | 53 | } |
54 | 54 | if ($haseditor) { |
55 | - $controllerRootUrl = str_replace('/controller.php', '', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)); |
|
56 | - $editorurlpath = $controllerRootUrl . '/' . preg_replace('|^' . preg_quote(__DIR__, '|') .'|', '', $editorpath); |
|
55 | + $controllerRootUrl = str_replace('/controller.php', '', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)); |
|
56 | + $editorurlpath = $controllerRootUrl.'/'.preg_replace('|^'.preg_quote(__DIR__, '|').'|', '', $editorpath); |
|
57 | 57 | /// @todo for cases above 4, 5 and up, look at $controllerRootUrl and check if the web root is not pointing directly |
58 | 58 | /// at this folder, as in that case the link to the visualeditor will not |
59 | 59 | /// work, as it will be in the form http(s)://domain/../../jsxmlrpc/debugger/visualeditor.html |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | } |
231 | 231 | |
232 | 232 | function activateeditor() { |
233 | - var url = '<?php echo $editorurlpath; ?>visualeditor.html?params=<?php echo str_replace(array("\\", "'"), array( "\\\\","\\'"), $alt_payload); ?>'; |
|
233 | + var url = '<?php echo $editorurlpath; ?>visualeditor.html?params=<?php echo str_replace(array("\\", "'"), array("\\\\", "\\'"), $alt_payload); ?>'; |
|
234 | 234 | if (document.frmaction.wstype.value == "1") |
235 | 235 | url += '&type=jsonrpc'; |
236 | 236 | var wnd = window.open(url, '_blank', 'width=750, height=400, location=0, resizable=1, menubar=0, scrollbars=1'); |
@@ -267,9 +267,9 @@ discard block |
||
267 | 267 | echo ' document.forms[2].submit();'; |
268 | 268 | } ?>"> |
269 | 269 | <h1>XMLRPC |
270 | - <form name="frmxmlrpc" style="display: inline;" action="."><input name="yes" type="radio" onclick="switchtransport(0);" <?php if (!class_exists('\PhpXmlRpc\Client')) { echo 'disabled="disabled"';} ?>/></form> |
|
270 | + <form name="frmxmlrpc" style="display: inline;" action="."><input name="yes" type="radio" onclick="switchtransport(0);" <?php if (!class_exists('\PhpXmlRpc\Client')) { echo 'disabled="disabled"'; } ?>/></form> |
|
271 | 271 | / |
272 | - <form name="frmjsonrpc" style="display: inline;" action="."><input name="yes" type="radio" onclick="switchtransport(1);" <?php if (!class_exists('\PhpXmlRpc\JsonRpc\Client')) { echo 'disabled="disabled"';} ?>/></form> |
|
272 | + <form name="frmjsonrpc" style="display: inline;" action="."><input name="yes" type="radio" onclick="switchtransport(1);" <?php if (!class_exists('\PhpXmlRpc\JsonRpc\Client')) { echo 'disabled="disabled"'; } ?>/></form> |
|
273 | 273 | JSONRPC Debugger (based on the <a href="https://gggeek.github.io/phpxmlrpc/">PHPXMLRPC</a> library) |
274 | 274 | </h1> |
275 | 275 | <form name="frmaction" method="get" action="action.php" target="frmaction" onSubmit="switchFormMethod();"> |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | </select> |
333 | 333 | </td> |
334 | 334 | <td class="labelcell">Timeout:</td> |
335 | - <td><input type="text" name="timeout" size="3" value="<?php if ($timeout > 0) { echo $timeout; } ?>"/></td> |
|
335 | + <td><input type="text" name="timeout" size="3" value="<?php if ($timeout>0) { echo $timeout; } ?>"/></td> |
|
336 | 336 | <td></td> |
337 | 337 | <td></td> |
338 | 338 | </tr> |