B2017-265 When pasting a Hyphen from MSWord in one of the first three characters the code would go into an infinite loop.
This commit is contained in:
parent
92eb33c044
commit
0a91bc1739
@ -820,9 +820,9 @@ namespace VEPROMS.CSLA.Library
|
||||
int indx = rtbString.IndexOf('-');
|
||||
while (indx > -1)
|
||||
{
|
||||
if (indx > 2)
|
||||
{
|
||||
if (rtbString[indx - 1] != 'i' || rtbString[indx - 2] != 'f' || rtbString[indx - 3] != '\\')
|
||||
// B2017-265 - Make sure that the location is at least 2 if checking the previous three charracters.
|
||||
// This occurs when pasting from MSWord
|
||||
if (indx < 2 || rtbString[indx - 1] != 'i' || rtbString[indx - 2] != 'f' || rtbString[indx - 3] != '\\')
|
||||
{
|
||||
rtbString = rtbString.Remove(indx, 1);
|
||||
rtbString = rtbString.Insert(indx, @"\u8209?");
|
||||
@ -830,7 +830,6 @@ namespace VEPROMS.CSLA.Library
|
||||
if (indx + 1 > rtbString.Length) indx = -1;
|
||||
else indx = rtbString.IndexOf('-', indx + 1);
|
||||
}
|
||||
}
|
||||
return Save(rtbString);
|
||||
}
|
||||
public bool Save(string modtext)
|
||||
|
Loading…
x
Reference in New Issue
Block a user