fix issue that can't update path(s) in preset option(s) with %APP_ROOT%

This commit is contained in:
slore 2020-06-03 17:45:49 +09:00
parent 4c57597410
commit 82aed2fb08
2 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@ function expand_opt_val(val, raw) {
var env_path = $app_root;
if (typeof(val) != 'string') return val;
if (!raw) {
env_path = $app_root.replace('\\', '\\\\');
env_path = $app_root.replace(/\\/g, '\\\\');
}
return str_replace(val, '%APP_ROOT%', env_path);
}

View File

@ -378,7 +378,7 @@ function patches_opt_stringify(line) {
if (line == null) line = "<br\/>";
str = str.replace(/("[^"]+?":".*?",)/g, "$1" + line);
str = str.replace(/("[^"]+?":[^"]+?,)/g, "$1" + line);
var env_path = $app_root.replace('\\', '\\\\');
var env_path = $app_root.replace(/\\/g, '\\\\');
str = str_replace(str, env_path, '%APP_ROOT%');
return str;
}