Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1
-
None
-
None
-
Operating System: All
Platform: PC
-
38569
Description
StringEscapeUtils.unescapeHtml skips the first entity after a standalone ampersand.
Code:
System.out.println(
StringEscapeUtils.unescapeHtml("test & ä ö")
);
Output:
test & ä ö
Expected output:
test & ä ö
Created an attachment (id=17838)
Patch to work around this issue
This patch works around spaces being between the '&' and the ';'. To be more
correct, it should probably ensure that all characters between the '&' and ';'
are valid entity characters, but in most cases the offending character is a
space.