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;
} else if (typeof(cmd) === "object") {
return cmd.map(function(s) {
var regex = /[ "]/g;
if (!regex.test(s)) {
if (s == '') {
return "''";
} else if (!/[ "]/g.test(s)) {
return s;
} else {
return "\"" + addslashes(s) + "\"";