Skip to content

Commit

Permalink
Fix LT-10373: Try a Word crashes for double quote and angle bracket (#75
Browse files Browse the repository at this point in the history
)

* Generalize Andy's fix to include angle bracket and other XML characters

---------

Co-authored-by: Andrew Black <[email protected]>
Co-authored-by: Jason Naylor <[email protected]>
  • Loading branch information
3 people authored Jun 5, 2024
1 parent e56040b commit 4962c35
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Src/LexText/ParserUI/TryAWordDlg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,8 @@ private void m_tryItButton_Click(object sender, EventArgs e)
// Display a "processing" message (and include info on how to improve the results)
var uri = new Uri(Path.Combine(TransformPath, "WhileTracing.htm"));
m_htmlControl.URL = uri.AbsoluteUri;
sWord = new System.Xml.Linq.XText(sWord).ToString(); // LT-10373 XML special characters cause a crash; change it so HTML/XML works
sWord = sWord.Replace("\"", "&quot;"); // LT-10373 same for double quote
sWord = sWord.Replace(' ', '.'); // LT-7334 to allow for phrases; do this at the last minute
m_parserListener.Connection.TryAWordDialogIsRunning = true; // make sure this is set properly
m_tryAWordResult = m_parserListener.Connection.BeginTryAWord(sWord, DoTrace, selectedTraceMorphs);
Expand Down

0 comments on commit 4962c35

Please sign in to comment.