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)
9 calls to Drush_TestCase::escapeshellarg()
backendCase::testOrigin in tests/backendTest.php
backendCase::testTarget in tests/backendTest.php
Drush_CommandTestCase::drush in tests/drush_testcase.inc
Invoke drush in via execute().
Drush_CommandTestCase::execute in tests/drush_testcase.inc
Actually runs the command. Does not trap the error stream output as this need PHP 4.3+.
shellAliasesCase::testShellAliasDrushRemote in tests/shellAliasTest.php

... See full list

File

tests/drush_testcase.inc, line 126

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);
  }
}