Skip to content

Commit

Permalink
Fix #5562
Browse files Browse the repository at this point in the history
  • Loading branch information
BalusC committed Feb 16, 2025
1 parent a82bfff commit 99e9204
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion impl/src/main/java/com/sun/faces/util/HtmlUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ static private boolean isPrintableControlChar(int ch, boolean forXml) {

public static boolean isAllowedXmlCharacter(int ch) {
// See https://www.w3.org/TR/xml/#charsets Character Range
return ch < 0x20 ? isPrintableControlChar(ch, true) : ch <= 0xD7FF || ch >= 0xE000 && ch <= 0xFFFD;
return ch < 0x20 ? isPrintableControlChar(ch, true) : ch <= 0xD7FF || ch >= 0xE000 && ch <= 0xFFFD || ch >= 0x10000 && ch <= 0x10FFFF;
}

/**
Expand Down
2 changes: 2 additions & 0 deletions impl/src/test/java/com/sun/faces/util/HtmlUtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class HtmlUtilsTest {
/**
* https://github.com/eclipse-ee4j/mojarra/issues/4516
* https://github.com/eclipse-ee4j/mojarra/issues/5464
* https://github.com/eclipse-ee4j/mojarra/issues/5562
*/
@Test
void testAllowedXmlCharacter() {
Expand Down Expand Up @@ -44,5 +45,6 @@ void testAllowedXmlCharacter() {

assertFalse(isAllowedXmlCharacter(0xFFFE));
assertFalse(isAllowedXmlCharacter(0xFFFF));
assertTrue(isAllowedXmlCharacter(0x1D11E));
}
}

0 comments on commit 99e9204

Please sign in to comment.