*/ 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:----se9w8/Fqh9t43meHb+UJLjUqH1/Y3U+Z8kYY97BwNL54rOfSaPwNQuNzj9VWjTigXfDtDACLidBrpjH8lZqag6R1ub41+bRoCk5xCW+7anZCnoUT1iSbsw6nhiHkeoftgU/+v86YRRJYzDVsr4wW0WwQBMga2PU3t+w+Cr+e4qQkpQjmoDOeou7Gs9P/3+HBXyrpaL6w3ZQF+N1ASoZ8C3oRBCllYx1aKobyWSUZwU4oTmGiroo2LfvOhPj/MIxmydv3SFWs1LoMQgRecYXGn7vT8vmh3/PDL+1iTWL+ZKUlrLKcS1eJWSz5Vm1C+aLMoy7iGe3TPlBkdsOF5+Er4W6PBcZgV94DE9j8EkGBnfOdKJ5mBIgBWmhLnbQ53MMdnDaVDFzPxvhY6N+cEt7k785o8lpnU/5qw69esjdUXrJEdNJxjwvGwuAuwjhBt1yNCauvC2cA4nPCBzFuFVEYvW28rHx2lDOLaUnnETn66GL/ZJm/PfnTCFyUXtnU3PnB3zrq+4Mia2b5hoxXBkRh8mBtKolcUCi/xyoTjDkMSVL1L7/BqCp3ZYuC2V/Q0JbDJTaSOqylXbiLfmHkPIzaXEVZdi4VpDs0XRtXGxvhJ8fo6PUv14ZK9+CzMa//E1m4OiXb+6kgQzNACp0MlmBFIuiwHuKJU9RNPnL3P9z5xGM=----ATTACHMENT:----NzAwNDEwMzU0MDU3NTU5MiAzODYwOTgwNzU1MjY2NDk3IDUwNzg2NjA2NjgxNzE4MzU=