Fix windows parameter encoding to prevent abuse of unicode characters with best fit encoding conversion
parent
5aa7b03b9d
commit
3130a7455a
|
@ -495,7 +495,9 @@ class ProcessExecutor
|
||||||
}
|
}
|
||||||
|
|
||||||
// New lines break cmd.exe command parsing
|
// New lines break cmd.exe command parsing
|
||||||
$argument = strtr($argument, "\n", ' ');
|
// and special chars like the fullwidth quote can be used to break out
|
||||||
|
// of parameter encoding via "Best Fit" encoding conversion
|
||||||
|
$argument = strtr($argument, ["\n" => ' ', '"' => '"', ':' => ':', '/' => '/']);
|
||||||
|
|
||||||
// In addition to whitespace, commas need quoting to preserve paths
|
// In addition to whitespace, commas need quoting to preserve paths
|
||||||
$quote = strpbrk($argument, " \t,") !== false;
|
$quote = strpbrk($argument, " \t,") !== false;
|
||||||
|
|
Loading…
Reference in New Issue