mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-30 08:33:19 +01:00
Escape arguments with spaces in event scripts
This commit is contained in:
@@ -480,7 +480,17 @@ namespace Tgstation.Server.Host.Components.StaticFiles
|
||||
using (var script = processExecutor.LaunchProcess(
|
||||
ioManager.ConcatPath(resolvedScriptsDir, I),
|
||||
resolvedScriptsDir,
|
||||
String.Join(' ', parameters),
|
||||
String.Join(
|
||||
' ',
|
||||
parameters.Select(arg =>
|
||||
{
|
||||
if (!arg.Contains(' ', StringComparison.Ordinal))
|
||||
return arg;
|
||||
|
||||
arg = arg.Replace("\"", "\\\"", StringComparison.Ordinal);
|
||||
|
||||
return $"\"{arg}\"";
|
||||
})),
|
||||
true,
|
||||
true,
|
||||
true))
|
||||
|
||||
Reference in New Issue
Block a user