Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- [SIL.Core.Clearshare] New tests MetadataBareTests are based on previous MetadataTests in SIL.Windows.Forms.Clearshare. The tests were updated to use ImageSharp instead of Winforms for handling images.

### Fixed
- [SIL.DictionaryServices] Fix memory leak in LiftWriter
- [SIL.WritingSystems] Fix IetfLanguageTag.GetGeneralCode to handle cases when zh-CN or zh-TW is a prefix and not the whole string.
- [SIL.Windows.Forms] Prevent BetterLabel from responding to OnTextChanged when it has been disposed.
- [SIL.Windows.Forms] Prevent ContributorsListControl.GetContributionFromRow from throwing an exception when the DataGridView has no valid rows selected.
Expand Down
20 changes: 11 additions & 9 deletions SIL.DictionaryServices/Lift/LiftWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -726,19 +726,21 @@ protected void WriteLanguageFormsInWrapper(IEnumerable<LanguageForm> forms, stri

string scaryUnicodeEscaped = form.Form.EscapeAnyUnicodeCharactersIllegalInXml();
string safeFromScaryUnicodeSoItStaysEscaped = scaryUnicodeEscaped.Replace("&#x", "");
XmlReader testerForWellFormedness = XmlReader.Create(new StringReader("<temp>" + safeFromScaryUnicodeSoItStaysEscaped + "</temp>"));

bool isTextWellFormedXml = true;
try
using (var stringReader = new StringReader("<temp>" + safeFromScaryUnicodeSoItStaysEscaped + "</temp>"))
using (var testerForWellFormedness = XmlReader.Create(stringReader))
{
while (testerForWellFormedness.Read())
try
{
//Just checking for well formed XML
while (testerForWellFormedness.Read())
{
//Just checking for well formed XML
}
}
catch
{
isTextWellFormedXml = false;
}
}
catch
{
isTextWellFormedXml = false;
}

if (isTextWellFormedXml)
Expand Down
Loading