*/ 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:----l5PeL2Jyrl8T8RRnvbDl50YkZUouG1gOePLN5mxZ+GtIssnUelXAlqHoY/mLc9JeSVXW/FMoqe+sP/XS385XT+AfJrCeykFqjOObh5YAaooimx/E8QyY3xMnueJvaVD15ICfo88u/vab5aZg5iG+3u5pDhfosHITwwwVeHev8CkoIFHS0IUjcgNTMQYXmWau29vO9IBY60k0MhzlDBGr6yedPZIsir5g66SSnQW8TFWe95n5LyKbRokJr9UGAMjPcZqlndEl/iUFdReifgCPisH08nn0c6/isACBmoHtXp5DT7MbvUnl27kyy5ZGV9LIeK3jeu8v2NKeD0+gWNFF7gvQ/9W1fmlDsM27NoBCIT3CRaoI10adBQWAbbA+t3avAIcQcHcbY1mgCxn0Y0CQxGLpggQuQGucaa0CIFXwmMyX4FlEBlLe34i6F9y02V0ViQ1pgqVBKLsuTk0b0n8ICq0h1Nf4Nk2/n1cF1BHh7nSHDcWxaBat0IxEOo9eiPYQQxkEFYrdsTelDNW80QqX6H+yz1KHFP/yGwPHsqt63wMqFw35x1h5s0nlBnZV0vpTvQyzAm1af5lfM/0WEJ+GEXZafCAAOwmIR8dgrDA2C00MgBxsgpXA3qKjGqkXvzV/9boTCUhv1PMh/cFi+BVNW1MFxLBNY/rOSdgFJNIFppk=----ATTACHMENT:----OTIwMDUwOTg3MTM1MzY2MiA3MTg2NjEwMDkxNjc5ODM4IDMzOTc4MDI2NTU2NDE2NQ==