Skip to content

Commit 4962c35

Browse files
jtmaxwell3AndyBlackjasonleenaylor
authored
Fix LT-10373: Try a Word crashes for double quote and angle bracket (#75)
* 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]>
1 parent e56040b commit 4962c35

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Src/LexText/ParserUI/TryAWordDlg.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,8 @@ private void m_tryItButton_Click(object sender, EventArgs e)
410410
// Display a "processing" message (and include info on how to improve the results)
411411
var uri = new Uri(Path.Combine(TransformPath, "WhileTracing.htm"));
412412
m_htmlControl.URL = uri.AbsoluteUri;
413+
sWord = new System.Xml.Linq.XText(sWord).ToString(); // LT-10373 XML special characters cause a crash; change it so HTML/XML works
414+
sWord = sWord.Replace("\"", "&quot;"); // LT-10373 same for double quote
413415
sWord = sWord.Replace(' ', '.'); // LT-7334 to allow for phrases; do this at the last minute
414416
m_parserListener.Connection.TryAWordDialogIsRunning = true; // make sure this is set properly
415417
m_tryAWordResult = m_parserListener.Connection.BeginTryAWord(sWord, DoTrace, selectedTraceMorphs);

0 commit comments

Comments
 (0)