public static function Drush_TestCase::_escapeshellarg_windows

6.x drush_testcase.inc public static Drush_TestCase::_escapeshellarg_windows($arg)
4.x drush_testcase.inc public static Drush_TestCase::_escapeshellarg_windows($arg)
5.x drush_testcase.inc public static Drush_TestCase::_escapeshellarg_windows($arg)
1 call to Drush_TestCase::_escapeshellarg_windows()

File

tests/drush_testcase.inc, line 140
Initialize a sandboxed environment. Starts with call unish_init() at bottom.

Class

Drush_TestCase

Code

public static function _escapeshellarg_windows($arg) {
  // Double up existing backslashes
  $arg = preg_replace('/\\\/', '\\\\\\\\', $arg);

  // Double up double quotes
  $arg = preg_replace('/"/', '""', $arg);

  // Double up percents.
  // $arg = preg_replace('/%/', '%%', $arg);

  // Add surrounding quotes.
  $arg = '"' . $arg . '"';

  return $arg;
}