invite: encode url data before posting it. closes #1285

This commit is contained in:
Hylke Bons 2013-05-15 17:16:17 +01:00
parent e93e868a45
commit b26d1b1d55
2 changed files with 4 additions and 2 deletions

View file

@ -52,6 +52,7 @@
<Reference Include="MonoMac">
<HintPath>..\..\..\monomac\src\MonoMac.dll</HintPath>
</Reference>
<Reference Include="System.Web" />
</ItemGroup>
<ItemGroup>
<Compile Include="AppDelegate.cs">

View file

@ -19,6 +19,7 @@ using System;
using System.IO;
using System.Net;
using System.Text;
using System.Web;
using System.Xml;
using SparkleLib;
@ -65,7 +66,7 @@ namespace SparkleShare {
if (string.IsNullOrEmpty (AcceptUrl))
return true;
string post_data = "public_key=" + public_key;
string post_data = "public_key=" + HttpUtility.UrlEncode (public_key);
byte [] post_bytes = Encoding.UTF8.GetBytes (post_data);
WebRequest request = WebRequest.Create (AcceptUrl);
@ -113,4 +114,4 @@ namespace SparkleShare {
}
}
}
}
}