b3d431156506d202eac02a658d4a1305416bcda481ec34b48cc68dba7f818458c08674b0b96138bb34daf8c51289971f60384ac33d6c8d1d49a5de0ba523a4 391 B

123456789101112
  1. 'use strict';
  2. var escapeArgument = require('./escapeArgument');
  3. function escapeCommand(command) {
  4. // Do not escape if this command is not dangerous..
  5. // We do this so that commands like "echo" or "ifconfig" work
  6. // Quoting them, will make them unaccessible
  7. return /^[a-z0-9_-]+$/i.test(command) ? command : escapeArgument(command, true);
  8. }
  9. module.exports = escapeCommand;