Merge Commit

This commit is contained in:
robvde 2015-03-21 13:31:25 +08:00
commit f968209010
145 changed files with 220103 additions and 1156 deletions

View file

@ -342,7 +342,7 @@ namespace WebsitePanel.Providers.EnterpriseStorage
}
}
file.Summary = reader[6] as string;
file.Summary = SanitizeXmlString(reader[6] as string);
result.Add(file);
}
@ -354,6 +354,36 @@ namespace WebsitePanel.Providers.EnterpriseStorage
}
public string SanitizeXmlString(string xml)
{
if (xml == null)
{
return null;
}
var buffer = new StringBuilder(xml.Length);
foreach (char c in xml.Where(c => IsLegalXmlChar(c)))
{
buffer.Append(c);
}
return buffer.ToString();
}
public bool IsLegalXmlChar(int character)
{
return
(
character == 0x9 /* == '\t' == 9 */ ||
character == 0xA /* == '\n' == 10 */ ||
character == 0xD /* == '\r' == 13 */ ||
(character >= 0x20 && character <= 0xD7FF) ||
(character >= 0xE000 && character <= 0xFFFD) ||
(character >= 0x10000 && character <= 0x10FFFF)
);
}
#region HostingServiceProvider methods
public override string[] Install()