function _drush_escapeshellarg_windows

8.0.x exec.inc _drush_escapeshellarg_windows($arg, $raw = FALSE)
6.x exec.inc _drush_escapeshellarg_windows($arg)
7.x exec.inc _drush_escapeshellarg_windows($arg, $raw = FALSE)
4.x drush.inc _drush_escapeshellarg_windows($arg)
5.x exec.inc _drush_escapeshellarg_windows($arg)
master startup.inc _drush_escapeshellarg_windows($arg, $raw = FALSE)

Windows version of escapeshellarg().

1 call to _drush_escapeshellarg_windows()

File

includes/startup.inc, line 183
Functions used when Drush is starting up.

Code

function _drush_escapeshellarg_windows($arg, $raw = FALSE) {
  // Double up existing backslashes
  $arg = preg_replace('/\\\/', '\\\\\\\\', $arg);

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

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

  // Only wrap with quotes when needed.
  if (!$raw) {
    // Add surrounding quotes.
    $arg = '"' . $arg . '"';
  }

  return $arg;
}