Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-52420

Links containing certain encoded special characters become double-encoded

    XMLWordPrintable

Details

    Description

      This ticket stems from CONFSERVER-45966. In that ticket, if you enter a link that contains url-encoded characters such as %25 or %2f, etc., those characters became double-encoded.

      The resolution in CONFSERVER-45966 resolved most of these characters including all umlaut and cyrillic characters per the description of that ticket.

      The problem is that there are certain characters which when encoded in the link are still being double encoded.

      Those characters are: "; , / ? : @ & = + $". The encoded versions of these characters are: "%3B %2C %2F %3F %3A %40 %26 %3D %2B %24" and if the link contains any of the encoded version, that character will be double-encoded.

       

      Workaround

      Option 1: Paste the link into the editor instead of using insert link dialog.

      • In this method you cannot modify the link text, so the link text will be automatically set based on the url

      Option 2: Use square brackets to insert the link. [ ]

      1. Type "["
      2. Type the text you want for your link in the editor, for example "My Link"
      3. Type a "|"
      4. Type the url
      5. Type "]" to complete the link.
      6. Save or preview the page to confirm it works.
      7. Important! Don't open the link dialog for this link. If you do, the link will be double-encoded.

      For step 4, you could also try pasting the url but this might have less success since the url will be converted to a link automatically and you might have to first undo that automatic conversion, which in turn may cause the closing "]" to have no effect. See option 3 instead.

      Option 3

      1. Paste the URL into the editor.
      2. Press undo to undo any automatic link creation/extraction so you see the original URL.
      3. If the URL is still a link, click it, and click "Unlink" to return it back to regular text.
      4. At the beginning of the link, type [ followed by `Escape` to exit the Link Autocomplete
      5. Type the text to display for the link followed by "|"
      6. Now your link should look like this
      7. Click at the end of the link and type "]" to complete the link. This should auto-convert it to a link with the desired text.
      8. Save or preview the page to confirm it works.
      9. Important! Don't open the link dialog for this link. If you do, the link will be double-encoded.

       

      Option 4: Using the Source Editor to change links after adding them

      1. Install the Confluence Source Editor (free add-on)
      2. Edit the page
      3. Click on the <> icon in the top right
      4. Find the href= attribute that contains the '%25' in the URL
      5. Replace it with just '%'
      6. Apply the changes and save the page

      Attachments

        Issue Links

          Activity

            People

              alyakovlev Alex Yakovlev (Inactive)
              alyakovlev Alex Yakovlev (Inactive)
              Votes:
              11 Vote for this issue
              Watchers:
              21 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: