public static function Drush_TestCase::escapeshellarg

6.x drush_testcase.inc public static Drush_TestCase::escapeshellarg($arg)
4.x drush_testcase.inc public static Drush_TestCase::escapeshellarg($arg)
5.x drush_testcase.inc public static Drush_TestCase::escapeshellarg($arg)

File

tests/drush_testcase.inc, line 53

Class

Drush_TestCase

Code

public static function escapeshellarg($arg) {
  // Short-circuit escaping for simple params (keep stuff readable)
  if (preg_match('|^[a-zA-Z0-9.:/_-]*$|', $arg)) {
    return $arg;
  }
  elseif (self::is_windows()) {
    return self::_escapeshellarg_windows($arg);
  }
  else {
    return escapeshellarg($arg);
  }
}