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

User macro param doesn't work as expected for iframe

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Medium
    • None
    • 2.10.3, 3.0
    • None

    Description

      Summary of the bug

      Create iframe using user macro with 3 params. $param0 indicates the src, $param1 indicates width and $param2 indicates the height. In the page where you use the macro, if the $param0 ( src ) contains parameters (particularly equals-to sign), the page cannot be displayed and throws Page Not Found in Confluence.

      How to reproduce

      Create a user macro with these parameters:
      Macro Name: myiframe
      Macro has a body : Untick / Tick (Both)
      Output: Macro generates HTML markup

      Template:
      <iframe src="$param0" width="$param1" height="$param2"></iframe>

      In the page:

      {myiframe:http://spreadsheets.google.com/pub?key=pwS2wRVw9u1dK1ujYw5AaAA|800|400}

      This will result in Page not Found (within Confluence). Click the link for the image.

      Extra Findings

      • When the URL is hardcoded in user macro, the external page is displayed correctly. Eg:

      User Macro

      <iframe src="http://spreadsheets.google.com/pub?key=pwS2wRVw9u1dK1ujYw5AaAA" width="$param0" height="$param1"></iframe>

      Page

      {myiframe:800|400}
      • The problem happens during the passing of parameters. Could be due to double equals-to sign. Eg: src="http://spreadsheets.google.com/pub?key=pwS2wRVw9u1dK1ujYw5AaAA"
      • Page source indicates the $param0 is not expanded: <iframe src=$param0 width="800" height="400"></iframe>
      • There is no problem if the user macro is tried within the {html} macro. Eg:
        {html}

        <iframe src="http://spreadsheets.google.com/pub?key=pwS2wRVw9u1dK1ujYw5AaAA" width="800" height="600"></iframe>

        {html}

      Workaround

      Escape the equals to sign (=) with &#61; Eg:

      {myiframe:http://spreadsheets.google.com/pub?key&#61;pwS2wRVw9u1dK1ujYw5AaAA|800|400} 
      

      The result is the expected result as indicated in this image

      Attachments

        1. UserMacroBug.png
          105 kB
          Sashidaran Jayaraman [Atlassian]
        2. WorkaroundUserMacro.png
          116 kB
          Sashidaran Jayaraman [Atlassian]

        Activity

          People

            shaffenden Steve Haffenden (Inactive)
            sjayaraman Sashidaran Jayaraman [Atlassian]
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: