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

Round-trips after entering image markup with width parameter (with quoted value) along with a page rename causes INVALID_CHARACTER_ERR error

XMLWordPrintable

      Steps to reproduce
      1. First attach an image to a new Confluence page
      2. Next, create the following markup in the page:
        !spaceKey:PageTitle^ImageName.gif|width="606"!
        

        Screenshot

      3. The image will be displayed as usual
      4. However, when you edit the page again and do some roundtrips (Wiki-markup -> Rich Text editor), the Wiki Markup becomes:
        !spaceKey:PageTitle^ImageName.gif|width=606"606"!
        

        Screenshot

      5. More round-trips causes more duplicate values for the width parameter:
        !spaceKey:PageTitle^ImageName.gif|width=606"606""606""606"!
        
      6. At this point, you are still allowed to edit and save the page.
      7. However, when there's a page title change, you are not allowed to save the page anymore. You will get an Oops page with the following error:
        org.w3c.dom.DOMException: INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified.
            at org.apache.xerces.dom.CoreDocumentImpl.createAttribute(Unknown Source) 
        
      8. You are also not allowed to switch to Wiki Markup editor to fix the markup.
        CantAccessWikiMarkup.png
      Workaround
      1. Don't use the quotes for the value. For example:
        !spaceKey:PageTitle^ImageName.gif|width=606!
        

        1. WikiMarkup.png
          WikiMarkup.png
          69 kB
        2. RenamingPage.png
          RenamingPage.png
          121 kB
        3. CantAccessWikiMarkup.png
          CantAccessWikiMarkup.png
          114 kB
        4. AfterSaving.png
          AfterSaving.png
          149 kB
        5. AfterRoundTrip.png
          AfterRoundTrip.png
          125 kB
        6. AfterRenamingRichText.png
          AfterRenamingRichText.png
          112 kB

              smansour Sherif Mansour
              sjayaraman Sashidaran Jayaraman [Atlassian]
              Votes:
              3 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: