fix #249, replace escapes before sending json rpc request to plugin [WIP]

This commit is contained in:
qianlifeng 2015-03-03 18:29:36 +08:00
parent 12265def19
commit 7e11c319e7

View File

@ -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>