|
@@ -17,7 +17,7 @@ discard block |
|
|
block discarded – undo |
|
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 |
|
|
block discarded – undo |
|
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 |
|
@@ -223,7 +223,7 @@ discard block |
|
|
block discarded – undo |
|
223
|
223
|
} |
|
224
|
224
|
|
|
225
|
225
|
function activateeditor() { |
|
226
|
|
- var url = '<?php echo $editorurlpath; ?>visualeditor.html?params=<?php echo str_replace(array("\\", "'"), array( "\\\\","\\'"), $alt_payload); ?>'; |
|
|
226
|
+ var url = '<?php echo $editorurlpath; ?>visualeditor.html?params=<?php echo str_replace(array("\\", "'"), array("\\\\", "\\'"), $alt_payload); ?>'; |
|
227
|
227
|
if (document.frmaction.wstype.value == "1") |
|
228
|
228
|
url += '&type=jsonrpc'; |
|
229
|
229
|
var wnd = window.open(url, '_blank', 'width=750, height=400, location=0, resizable=1, menubar=0, scrollbars=1'); |
|
@@ -260,9 +260,9 @@ discard block |
|
|
block discarded – undo |
|
260
|
260
|
echo ' document.forms[2].submit();'; |
|
261
|
261
|
} ?>"> |
|
262
|
262
|
<h1>XML-RPC |
|
263
|
|
- <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> |
|
|
263
|
+ <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> |
|
264
|
264
|
/ |
|
265
|
|
- <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> |
|
|
265
|
+ <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> |
|
266
|
266
|
JSON-RPC Debugger (based on the <a href="https://gggeek.github.io/phpxmlrpc/">PHPXMLRPC</a> library, ver. <?php echo htmlspecialchars(\PhpXmlRpc\PhpXmlRpc::$xmlrpcVersion)?>) |
|
267
|
267
|
</h1> |
|
268
|
268
|
<form name="frmaction" method="get" action="action.php" target="frmaction" onSubmit="switchFormMethod();"> |
|
@@ -325,7 +325,7 @@ discard block |
|
|
block discarded – undo |
|
325
|
325
|
</select> |
|
326
|
326
|
</td> |
|
327
|
327
|
<td class="labelcell">Timeout:</td> |
|
328
|
|
- <td><input type="text" name="timeout" size="3" value="<?php if ($timeout > 0) { echo $timeout; } ?>"/></td> |
|
|
328
|
+ <td><input type="text" name="timeout" size="3" value="<?php if ($timeout>0) { echo $timeout; } ?>"/></td> |
|
329
|
329
|
<td></td> |
|
330
|
330
|
<td></td> |
|
331
|
331
|
</tr> |