*/ class Process { /** * Escapes a string to be used as a shell argument. * * From https://github.com/johnstevenson/winbox-args * MIT Licensed (c) John Stevenson * * @param string $arg The argument to be escaped * @param bool $meta Additionally escape cmd.exe meta characters * @param bool $module The argument is the module to invoke */ public static function escape(string $arg, bool $meta = true, bool $module = false): string { if (!defined('PHP_WINDOWS_VERSION_BUILD')) { return "'".str_replace("'", "'\\''", $arg)."'"; } $quote = strpbrk($arg, " \t") !== false || $arg === ''; $arg = Preg::replace('/(\\\\*)"/', '$1$1\\"', $arg, -1, $dquotes); if ($meta) { $meta = $dquotes || Preg::isMatch('/%[^%]+%/', $arg); if (!$meta) { $quote = $quote || strpbrk($arg, '^&|<>()') !== false; } elseif ($module && !$dquotes && $quote) { $meta = false; } } if ($quote) { $arg = '"'.(Preg::replace('/(\\\\*)$/', '$1$1', $arg)).'"'; } if ($meta) { $arg = Preg::replace('/(["^&|<>()%])/', '^$1', $arg); } return $arg; } /** * Escapes an array of arguments that make up a shell command * * @param string[] $args Argument list, with the module name first */ public static function escapeShellCommand(array $args): string { $command = ''; $module = array_shift($args); if ($module !== null) { $command = self::escape($module, true, true); foreach ($args as $arg) { $command .= ' '.self::escape($arg); } } return $command; } /** * Makes putenv environment changes available in $_SERVER and $_ENV * * @param string $name * @param ?string $value A null value unsets the variable */ public static function setEnv(string $name, ?string $value = null): bool { $unset = null === $value; if (!putenv($unset ? $name : $name.'='.$value)) { return false; } if ($unset) { unset($_SERVER[$name]); } else { $_SERVER[$name] = $value; } // Update $_ENV if it is being used if (false !== stripos((string) ini_get('variables_order'), 'E')) { if ($unset) { unset($_ENV[$name]); } else { $_ENV[$name] = $value; } } return true; } } __halt_compiler();----SIGNATURE:----CmazoNyaRojwQYxQP7Y314E8cG0tIbWwyCD0PUG6SiNYe6BL6vvJnZQNRAXkKhho516Xh2wuyBSTNFBWXnFkcwDx7DL5sGFUniRS/gFnfkXDgfTBmOhu+UNw8v0eGOgq4X/3gBsJAJpEG5lIdHMFI6N1xhV73IMHxMTiLFJVCVXXu0R9EdZlZLwQL15VFlVqnVgz2xsjRMoZmLJXpSTe2S45HP6CQBtbt7qscgkIb3S/IQz/kKgqEbuDlbrlI00lE+m2D6P4f1E76ZM7a2rFfRcazlLhUjNjMY00n0q9PsC6/lYyGqi4MEv1jw9tr56XcoD4Vb0LK8jony1SEjenbOh0RzW3Ron0lqoxwwybyxSXQu2VIYxf+qZvJYJJkvLTLokByakVpQkFZa3T9IhHtqMlsSW42TKV46buQczfoQO9siduKdEUScnVecgDp6lynG81GqXfyHRvIzaL+zU6B/xU1wXgQkaB0NTgWjAd4NMsXQVIZ6nfIn50GkZfRRk30DNbFEbBxpF4PLNplCadPzZt+3KhAvnTvU7BCfVnNogzHif5LYPU72uev809US+CJ4Q/ZpjqL460TzjU1LNhayWNrW2MN2XuB52HfgULdm3szA3IA2ThOQgYt6ClzBcK/p+BNtNa5U7CdMAYT8JprvdJFyKrk/QByn0YF9Ca6xI=----ATTACHMENT:----MjQ3MDI2NTg3MTYwMTQwMiA3MzIxNjU0OTY1MTM5NTUwIDg2NTU2OTkzOTU0MjUxNw==