arturobernalg commented on code in PR #584:
URL: https://github.com/apache/jspwiki/pull/584#discussion_r4500543345


##########
jspwiki-wysiwyg/src/main/java/org/apache/wiki/htmltowiki/HtmlStringToWikiTranslator.java:
##########
@@ -144,10 +149,29 @@ public static String element2String( final Element 
element ) {
      */
     private static final class AttributeUriFilter extends XMLFilterImpl {
 
+        private static final Set< String > EXTERNAL_ENTITY_FEATURES = new 
HashSet<>( Arrays.asList(
+                "http://xml.org/sax/features/external-general-entities";,
+                "http://xml.org/sax/features/external-parameter-entities"; ) );

Review Comment:
   Good question. Nothing here needs those features. JDOM 2.0.6.1 asks its 
reader to enable external-general-entities, and the HTML parser of 
htmlunit-neko does not know that feature and throws, so the translator failed. 
The filter only ignores that failure for those two feature names, it does not 
enable anything. I checked with an HTML document that declares an external 
entity pointing to a local file: the output keeps the literal &xxe; and the 
content of the file is not read. In this code JDOM is used to read the XHTML 
that the HTML parser produces from the editor, before it is turned into wiki 
markup.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to