|
|
|
@ -15903,11 +15903,39 @@ BI.ShowAction = BI.inherit(BI.Action, {
|
|
|
|
|
|
|
|
|
|
// replace the html special tags
|
|
|
|
|
BI.htmlEncode = function (text) { |
|
|
|
|
return (text == null) ? "" : String(text).replace(/&/g, "&").replace(/\"/g, """).replace(/</g, "<").replace(/>/g, ">").replace(/\s/g, " "); |
|
|
|
|
return text === null ? "" : BI.replaceAll(text + "", /&|\"|<|>|\s/, function (v) { |
|
|
|
|
switch (v) { |
|
|
|
|
case "&": |
|
|
|
|
return "&"; |
|
|
|
|
case "\"": |
|
|
|
|
return """; |
|
|
|
|
case "<": |
|
|
|
|
return "<"; |
|
|
|
|
case ">": |
|
|
|
|
return ">"; |
|
|
|
|
case " ": |
|
|
|
|
default: |
|
|
|
|
return " "; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
// html decode
|
|
|
|
|
BI.htmlDecode = function (text) { |
|
|
|
|
return (text == null) ? "" : String(text).replace(/&/g, "&").replace(/"/g, "\"").replace(/</g, "<").replace(/>/g, ">").replace(/ /g, " "); |
|
|
|
|
return text === null ? "" : BI.replaceAll(text + "", /&|"|<|>| /, function (v) { |
|
|
|
|
switch (v) { |
|
|
|
|
case "&": |
|
|
|
|
return "&"; |
|
|
|
|
case """: |
|
|
|
|
return "\""; |
|
|
|
|
case "<": |
|
|
|
|
return "<"; |
|
|
|
|
case ">": |
|
|
|
|
return ">"; |
|
|
|
|
case " ": |
|
|
|
|
default: |
|
|
|
|
return " "; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
BI.cjkEncodeDO = function (o) { |
|
|
|
@ -16079,7 +16107,7 @@ BI.ShowAction = BI.inherit(BI.Action, {
|
|
|
|
|
BI.encodeURIComponent = function (url) { |
|
|
|
|
BI.specialCharsMap = BI.specialCharsMap || {}; |
|
|
|
|
url = url || ""; |
|
|
|
|
url = BI.replaceAll(url, BI.keys(BI.specialCharsMap || []).join("|"), function (str) { |
|
|
|
|
url = BI.replaceAll(url + "", BI.keys(BI.specialCharsMap || []).join("|"), function (str) { |
|
|
|
|
switch (str) { |
|
|
|
|
case "\\": |
|
|
|
|
return BI.specialCharsMap["\\\\"] || str; |
|
|
|
@ -16096,7 +16124,7 @@ BI.ShowAction = BI.inherit(BI.Action, {
|
|
|
|
|
reserveSpecialCharsMap[encodeChar] = initialChar; |
|
|
|
|
}); |
|
|
|
|
url = url || ""; |
|
|
|
|
url = BI.replaceAll(url, BI.keys(reserveSpecialCharsMap || []).join("|"), function (str) { |
|
|
|
|
url = BI.replaceAll(url + "", BI.keys(reserveSpecialCharsMap || []).join("|"), function (str) { |
|
|
|
|
return reserveSpecialCharsMap[str] || str; |
|
|
|
|
}); |
|
|
|
|
return _global.decodeURIComponent(url); |
|
|
|
|