Update shell.js

This commit is contained in:
Namhyeon Go 2022-01-13 17:46:28 +09:00 committed by GitHub
parent 8b4e2c1e66
commit d366427b62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,8 +51,9 @@ var ShellObject = function() {
return cmd; return cmd;
} else if (typeof(cmd) === "object") { } else if (typeof(cmd) === "object") {
return cmd.map(function(s) { return cmd.map(function(s) {
var regex = /[ "]/g; if (s == '') {
if (!regex.test(s)) { return "''";
} else if (!/[ "]/g.test(s)) {
return s; return s;
} else { } else {
return "\"" + addslashes(s) + "\""; return "\"" + addslashes(s) + "\"";