1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

B #2384: Start script base64 enconding fails when using non utf8 chars (#2385)

This commit is contained in:
Abel Coronado 2018-09-05 18:29:07 +02:00 committed by Tino Vázquez
parent e89810b70d
commit 6169e16c75

View File

@ -232,7 +232,7 @@ define(function(require) {
var start_script = WizardFields.retrieveInput($(".START_SCRIPT", context));
if (start_script != "") {
if ($(".ENCODE_START_SCRIPT", context).is(":checked")) {
contextJSON["START_SCRIPT_BASE64"] = btoa($(".START_SCRIPT", context).val());
contextJSON["START_SCRIPT_BASE64"] = btoa(unescape(encodeURIComponent($(".START_SCRIPT", context).val())));
} else {
contextJSON["START_SCRIPT"] = start_script;
}
@ -341,7 +341,7 @@ define(function(require) {
} else if ("START_SCRIPT_BASE64" == key) {
$(".ENCODE_START_SCRIPT", context).prop('checked', 'checked');
$(".START_SCRIPT", context).val(atob(value));
$(".START_SCRIPT", context).val(decodeURIComponent(escape(window.atob(value))));
} else if ("START_SCRIPT" == key) {
WizardFields.fillInput($(".START_SCRIPT", context), value);
} else {