mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-14 03:37:10 +08:00
fix #249, replace escapes before sending json rpc request to plugin [WIP]
This commit is contained in:
parent
12265def19
commit
7e11c319e7
@ -74,7 +74,7 @@ namespace Wox.Core.Plugin
|
||||
|
||||
if (paramter is string)
|
||||
{
|
||||
return string.Format(@"\""{0}\""", paramter);
|
||||
return string.Format(@"\""{0}\""", RepalceEscapes(paramter.ToString()));
|
||||
}
|
||||
if (paramter is int || paramter is float || paramter is double)
|
||||
{
|
||||
@ -86,6 +86,13 @@ namespace Wox.Core.Plugin
|
||||
}
|
||||
return paramter.ToString();
|
||||
}
|
||||
|
||||
private string RepalceEscapes(string str)
|
||||
{
|
||||
return str.Replace(@"\", @"\\") //Escapes in ProcessStartInfo
|
||||
.Replace(@"\", @"\\"); //Escapes itself when passed to client
|
||||
//todo: replace "
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user