Polish HtmlCharacterEntityDecoder

See gh-27833
This commit is contained in:
izeye
2021-12-17 23:11:24 +09:00
committed by Stephane Nicoll
parent db21cbd4af
commit 731af9444c

View File

@@ -70,13 +70,6 @@ class HtmlCharacterEntityDecoder {
this.nextSemicolonPosition = this.originalMessage.indexOf(';', this.nextPotentialReferencePosition + 1);
}
boolean isPotentialReference = (this.nextPotentialReferencePosition != -1 &&
this.nextSemicolonPosition != -1 &&
this.nextSemicolonPosition - this.nextPotentialReferencePosition < MAX_REFERENCE_SIZE);
if (isPotentialReference) {
break;
}
if (this.nextPotentialReferencePosition == -1) {
break;
}
@@ -85,6 +78,10 @@ class HtmlCharacterEntityDecoder {
break;
}
if (this.nextSemicolonPosition - this.nextPotentialReferencePosition < MAX_REFERENCE_SIZE) {
break;
}
this.nextPotentialReferencePosition = this.nextPotentialReferencePosition + 1;
}
while (this.nextPotentialReferencePosition != -1);