Launcher xml parsing fix
This commit is contained in:
@@ -361,33 +361,18 @@ namespace Launcher2
|
|||||||
|
|
||||||
string xml = response.Content;
|
string xml = response.Content;
|
||||||
|
|
||||||
string _byteOrderMarkUtf8 = System.Text.Encoding.UTF8.GetString(System.Text.Encoding.UTF8.GetPreamble());
|
|
||||||
if (xml.StartsWith(_byteOrderMarkUtf8))
|
|
||||||
{
|
|
||||||
xml = xml.Remove(0, _byteOrderMarkUtf8.Length);
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return XDocument.Parse(xml);
|
return XDocument.Parse(xml);
|
||||||
}
|
}
|
||||||
|
|
||||||
catch
|
catch
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
int index = xml.IndexOf('<');
|
int index = xml.IndexOf('<');
|
||||||
xml = xml.Substring(index, xml.Length-index);
|
xml = xml.Substring(index, xml.Length - index);
|
||||||
|
|
||||||
return XDocument.Parse(xml);
|
return XDocument.Parse(xml);
|
||||||
}
|
}
|
||||||
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool CheckUpdateXML(XDocument doc)
|
private bool CheckUpdateXML(XDocument doc)
|
||||||
|
|||||||
Reference in New Issue
Block a user