danfickle / danfickle/openhtmltopdf

Image SRC URL with parameters fails

Open
#849 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.2k
Forks
423
PR merge metrics
No merged PRs in 30d

Description

A HTML document with an IMG tag will fail if the URL of the image SRC attribute has multiple parameters.

Example:
<img alt="" src="https://myserver/media/conr?cmd=file&target=A_s46D32PzAKrb966DQ_Srpno64JN4QUYRb5oe6cgzNzmHL1EckvrEhFw981_SbW0Ye_PwMhovvx5UYA_E_E&export=true&mmjwt=eyJGciOiJIUzI1NiJ9.eyJqdGkiMzZjNDY0YTY1YjYwZTlhZjBiN2QwYWQzZSIsImlhdCI6MTY1NjM3ODQ5MCwic3ViIjoiNjQwNDUwNyIsImlzcyI6IndlYmFzc2Vzc29yIic5MDkwfQ.mIp3XY_uoqwfUPwZGUIHR1W5r7djJppWliu-zKZ8B-c" style="width: 240px; height: 175px;" />

Relevant stack trace:
Caused by: javax.xml.transform.TransformerException: org.xml.sax.SAXParseException; lineNumber: 61; columnNumber: 147; The reference to entity "target" must end with the ';' delimiter.
at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:469)
at com.openhtmltopdf.resource.XMLResource$XMLResourceBuilder.createXMLResource(XMLResource.java:251)
at com.openhtmltopdf.resource.XMLResource$XMLResourceBuilder.access$100(XMLResource.java:145)
at com.openhtmltopdf.resource.XMLResource.load(XMLResource.java:71)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.