public static function UnishTestCase::escapeshellarg

8.0.x UnishTestCase.php public static UnishTestCase::escapeshellarg($arg)
7.x UnishTestCase.php public static UnishTestCase::escapeshellarg($arg)
master UnishTestCase.php public static UnishTestCase::escapeshellarg($arg)
11 calls to UnishTestCase::escapeshellarg()
backendCase::testOrigin in tests/backendTest.php
Covers the following origin responsibilities.
backendCase::testTarget in tests/backendTest.php
Covers the following target responsibilities.
cacheCommandCase::testCacheSet in tests/cacheCommandTest.php
CommandUnishTestCase::drush in tests/Unish/CommandUnishTestCase.php
Invoke drush in via execute().
CommandUnishTestCase::execute in tests/Unish/CommandUnishTestCase.php
Actually runs the command.

... See full list

File

tests/Unish/UnishTestCase.php, line 151

Namespace

Unish

Class

UnishTestCase

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