Merge with upstream master

This commit is contained in:
billz
2021-06-05 12:02:26 +01:00
22 changed files with 428 additions and 223 deletions

View File

@@ -603,11 +603,10 @@ function mb_escapeshellarg($arg)
{
$isWindows = strtolower(substr(PHP_OS, 0, 3)) === 'win';
if ($isWindows) {
$escaped_arg = str_replace(array('"', '%'), '', $arg);
return '"' . str_replace(array('"', '%'), '', $arg) . '"';
} else {
$escaped_arg = str_replace("'", "'\\''", $arg);
return "'" . str_replace("'", "'\\''", $arg) . "'";
}
return "\"$escaped_arg\"";
}
function dnsServers()
@@ -776,3 +775,11 @@ function qr_encode($str)
{
return preg_replace('/(?<!\\\)([\":;,])/', '\\\\\1', $str);
}
function evalHexSequence($string) {
$evaluator = function ($input) {
return hex2bin($input[1]);
};
return preg_replace_callback('/\\\x(..)/', $evaluator, $string);
}