mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +02:00
fix #249, replace escapes before sending json rpc request to plugin [WIP]
This commit is contained in:
@@ -74,7 +74,7 @@ namespace Wox.Core.Plugin
|
|||||||
|
|
||||||
if (paramter is string)
|
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)
|
if (paramter is int || paramter is float || paramter is double)
|
||||||
{
|
{
|
||||||
@@ -86,6 +86,13 @@ namespace Wox.Core.Plugin
|
|||||||
}
|
}
|
||||||
return paramter.ToString();
|
return paramter.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string RepalceEscapes(string str)
|
||||||
|
{
|
||||||
|
return str.Replace(@"\", @"\\") //Escapes in ProcessStartInfo
|
||||||
|
.Replace(@"\", @"\\"); //Escapes itself when passed to client
|
||||||
|
//todo: replace "
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user