*/ 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:----r3Sp2LMFRYi8vjPneffsOG3T/nFjf/mlncX+e5YpwiTazWKfaj8O8S0TwYZ4SLI02na7uMkAxXfvjWEl8McUoEwRqcE8+jjh1J9SMzRhqXnUJ7YnFAw+KBZeOL6HkLWuwGTQPtT9/PI9/eDtsUfNEx4xZX3fRE8ODmYSnbfWlYFtnFlMMHLmkO9FQOjUyMF+yFIHR7dcGW3mqgadWPQLOst9L5v/IFqKzZii/dSqdSEacLYJECSju+Pakw1gcBFVVzbnX8KQnXTrPor4F+O/8Mj2+dClFw1dqX2gQcg+7FwcnGfLexPppNUfJvQiji9UoAEHR7rQU/5CxBGnSEf5t86ZVeQdZ3WJYsxhlVX43blpdni9njDig/5ces78wfEfSaDSlGffnNbjmLcxUySWtDImomX9G4cVIogNk5YQt6T1dP/TfQ60x25TBa+MF4UBEMMpC4I0hCJUw44dE4jrHnre0bm57VfpeBRqHEczyvZJYCNMe/v0VQFEZ7DtKsjrA90tWyovkKrw7PPS/t1c6KTZrAVWZd0XefatRaLutquIVnPwQunWJH90tZ+USJfByFcvK8eT3wVVM5dX8N7cZydaP5mKxVR0bbJuMoAn0rpLLfpyJjO2z26wVgHS4VzXX8k7Tse7XgMDTC3PforfsVZwaBG4aTauSsqV9Kq5O3k=----ATTACHMENT:----NTM0MTE5MTEwMDQ4NDI3MyA4NDE0OTc0Njg3MDQ5ODczIDQ0NzcwNDEzNzc4OTUzNDQ=