public static function UnishTestCase::_escapeshellarg_windows

8.0.x UnishTestCase.php public static UnishTestCase::_escapeshellarg_windows($arg)
7.x UnishTestCase.php public static UnishTestCase::_escapeshellarg_windows($arg)
master UnishTestCase.php public static UnishTestCase::_escapeshellarg_windows($arg)
1 call to UnishTestCase::_escapeshellarg_windows()

File

tests/Unish/UnishTestCase.php, line 161

Namespace

Unish

Class

UnishTestCase

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