fix URI encoding and let SECoP module show value

- URI encoding must happen by element
- show values in SECoP module
This commit is contained in:
l_samenv
2024-09-27 13:47:59 +02:00
parent 09c3a5840a
commit cd306c45ac
3 changed files with 3 additions and 5 deletions

View File

@ -206,7 +206,7 @@ function updateValues(message, src) {
for (var j = 0; j < matches.length; j++) {
var type = matches[j].__ctype__;
if (type == "rdonly") {
if (type == "rdonly" || type == "rdlink") {
var text = htmlEscape(value);
if (text) {
matches[j].innerHTML = text;
@ -247,7 +247,6 @@ function updateValues(message, src) {
function reqJSON(s, url, successHandler, errorHandler) {
var xhr = typeof XMLHttpRequest != 'undefined' ? new XMLHttpRequest()
: new ActiveXObject('Microsoft.XMLHTTP');
url = encodeURI(url);
if (debugCommunication) {
console.log("%cto server (reqJSON): %s",
"color:white;background:lightgreen", url);
@ -274,7 +273,6 @@ function reqJSON(s, url, successHandler, errorHandler) {
function reqJSONPOST(s, url, parameters, successHandler, errorHandler) {
var xhr = typeof XMLHttpRequest != 'undefined' ? new XMLHttpRequest()
: new ActiveXObject('Microsoft.XMLHTTP');
url = encodeURI(url);
if (debugCommunication) {
console.log("%cto server (reqJSON): %s",
"color:white;background:lightgreen", url);

View File

@ -48,7 +48,7 @@ function createContentConsole(s) {
histIndex = -1;
// Request for command.
reqJSON(s, "http://" + hostPort + "/sendcommand?command="
+ commandline.value + "&id=" + clientID, successHandler,
+ encodeURIComponent(commandline.value) + "&id=" + clientID, successHandler,
errorHandler);
commandline.value = "";
};

View File

@ -27,7 +27,7 @@ function getGroup(s, name) {
}
function sendCommand(s, command) {
reqJSON(s, "http://" + hostPort + "/sendcommand?command=" + command
reqJSON(s, "http://" + hostPort + "/sendcommand?command=" + encodeURIComponent(command)
+ "&id=" + clientID, successHandler, errorHandler);
}