mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-02 06:22:20 +00:00
fixed edge case in entity reduction code
This commit is contained in:
parent
2ef3f28f3f
commit
c3c9c9c825
@ -676,10 +676,18 @@ void HTMLContentSink::ReduceEntities(nsString& aString) {
|
||||
dtd->ConvertEntityToUnicode(theNCRStr, &theNCRValue);
|
||||
theEntity=PRUnichar(theNCRValue);
|
||||
}
|
||||
else {
|
||||
//what looked like an entity is not really one.
|
||||
//so let's copy the ncrstring back to the output string
|
||||
aString.Mid(theNCRStr,theAmpPos,theSemiPos-theAmpPos+1);
|
||||
theOutString.Append(theNCRStr);
|
||||
}
|
||||
break;
|
||||
} //switch
|
||||
|
||||
theOutString.Append(theEntity);
|
||||
|
||||
if(theEntity) {
|
||||
theOutString.Append(theEntity);
|
||||
}
|
||||
theAmpPos = aString.FindChar('&',PR_FALSE,theSemiPos+1);
|
||||
|
||||
} //while
|
||||
|
@ -676,10 +676,18 @@ void HTMLContentSink::ReduceEntities(nsString& aString) {
|
||||
dtd->ConvertEntityToUnicode(theNCRStr, &theNCRValue);
|
||||
theEntity=PRUnichar(theNCRValue);
|
||||
}
|
||||
else {
|
||||
//what looked like an entity is not really one.
|
||||
//so let's copy the ncrstring back to the output string
|
||||
aString.Mid(theNCRStr,theAmpPos,theSemiPos-theAmpPos+1);
|
||||
theOutString.Append(theNCRStr);
|
||||
}
|
||||
break;
|
||||
} //switch
|
||||
|
||||
theOutString.Append(theEntity);
|
||||
|
||||
if(theEntity) {
|
||||
theOutString.Append(theEntity);
|
||||
}
|
||||
theAmpPos = aString.FindChar('&',PR_FALSE,theSemiPos+1);
|
||||
|
||||
} //while
|
||||
|
Loading…
x
Reference in New Issue
Block a user