Skip to content

Commit

Permalink
integrated fix for 0097-WebUI-SetSysvarValueByUser WebUI patch where …
Browse files Browse the repository at this point in the history
…plain % char could not be used in system variable texts (#1925, #1932, @jp112sdl)
  • Loading branch information
jp112sdl authored Sep 14, 2022
1 parent 316bdbb commit 3f0e559
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@
{
var s = "";
s += "<table class='CLASS05010'>";
@@ -351,7 +427,27 @@
@@ -351,7 +427,33 @@
s += "</tr>";
s += "</table>";
$("tdEdit").innerHTML = s;
Expand All @@ -400,22 +400,28 @@
+ s += "</table>";
+ $("tdValueEdit").innerHTML = s;
+
}
+ }
+
+ function decodeURIComponentSafe(s) {
+ if (!s) {
+ return s;
+ }
+ return decodeURIComponent(s.replace(/%(?![0-9][0-9a-fA-F]+)/g, '%25'));
}
+
+ loadChar8859Edit = function(sValue)
+ {
+ var s = "";
+ s += "<table class='CLASS05012'>";
+ s += "<tr><td> <textarea id='txValue' rows='5'>"+decodeURIComponent(unescape(sValue))+"</textarea> </td></tr>";
+ s += "<tr><td> <textarea id='txValue' rows='5'>"+decodeURIComponentSafe(unescape(sValue))+"</textarea> </td></tr>";
+ s += "</table>";
+ $("tdValueEdit").innerHTML = s;
+ $("tdEdit").innerHTML = "";
+ };

<%
if (system.GetVar("createNew") == 1) {
@@ -361,27 +457,43 @@
@@ -361,27 +463,43 @@
if ( (sv.Channel() != ID_ERROR) && (sv.Channel() != 0)) {
object oChn = dom.GetObject(sv.Channel());
if (oChn) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,12 +438,18 @@

}

function decodeURIComponentSafe(s) {
if (!s) {
return s;
}
return decodeURIComponent(s.replace(/%(?![0-9][0-9a-fA-F]+)/g, '%25'));
}

loadChar8859Edit = function(sValue)
{
var s = "";
s += "<table class='CLASS05012'>";
s += "<tr><td> <textarea id='txValue' rows='5'>"+decodeURIComponent(unescape(sValue))+"</textarea> </td></tr>";
s += "<tr><td> <textarea id='txValue' rows='5'>"+decodeURIComponentSafe(unescape(sValue))+"</textarea> </td></tr>";
s += "</table>";
$("tdValueEdit").innerHTML = s;
$("tdEdit").innerHTML = "";
Expand Down

0 comments on commit 3f0e559

Please sign in to comment.