Broken percent-encoding in link interrupts PDF export

XMLWordPrintable

    • 6
    • Severity 3 - Minor
    • 0

      Summary

      Invalid escape character of percent-encoding causes "URLDecoder: Incomplete trailing escape (%) pattern".

      Steps to Reproduce

      1. Create a page (P1) containing TOC macro and heading in multi-byte chars
      2. Create a page (P2) containing a link to P1's heading
      3. Export the page P2 to PDF and confirm it works correctly
      4. Edit the page P2 to make the link's URL invalid against percent-encoding
        • The example below contains invalid percent-encoding
          http://confluence.localtest.me/display/SS/Linked+page#Linkedpage-%E6%97%A5%E6%9C%AC%E8%AA%9E%E3%81%AE%E8%A6%8B%E5%87%BA%E3%81%
          
      5. Export the page P2 to PDF and confirm it complains exception

      Expected Results

      PDF export doesn't get interrupted by broken link in page.

      Actual Results

      The below exception is thrown in the logs/atlassian-confluence.log file:

      java.lang.IllegalArgumentException: URLDecoder: Incomplete trailing escape (%) pattern
      	at java.net.URLDecoder.decode(URLDecoder.java:187)
      	at com.atlassian.confluence.extra.flyingpdf.html.LinkFixer.decodeTitle(LinkFixer.java:96)
      

      Workaround

      Fix the broken link. If you are trying to export space to PDF, it's hard to identify which page causing the exception. Refer How to identify which page facing unrecoverable error for those cases.

            Assignee:
            Unassigned
            Reporter:
            K. Yamamoto
            Votes:
            5 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: