Skip to content

closing bracket in URI should be escaped #284

Description

@nbeisert

An html link <a> whose href contains a closing bracket ) leads to a PDF with a slightly corrupted structure because the bracket is not escaped as \) in the PDF element. In practice the link is terminated at the bracket (and the following text might get interpreted as further PDF elements)

Example:

<html><head><title>test</title></head>
<body>
<a href="http://test/closing)bracket">link</a>
</body>
</html>

This is translated to a PDF with the element /URI (http://test/closing)bracket) which should rather be /URI (http://test/closing\)bracket).
Checking the integrity of the PDF leads to a warning/error, e.g.: qpdf --check test.pdf outputs:

test.pdf (file position 4990): unknown token while reading object (bracket)

Tried with version 0.23 and present version on github.

Potentially, some other characters are affected as well? E.g., the backslash \ itself is converted to %5C.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugExisting features not working as expected

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions