Atlassian HTML macro makes saved page redirect to "data:text/html,"

We're preparing to move to Confluence 5.1.3, and in our test installation, one of our pages does something very strange -- when you go from the editor, either saving or cancelling, the page displays briefly, then immediately redirects to a garbage address "data:text/html,<p></p>". That looks like there might be an extra quote mark somewhere when the HTML is rendered.

I've tracked this down to an HTML macro that has some fairly complex HTML in it, but does not have an extra quote or other errors. This does not happen in version 4.0.4, our previous version.

Note that this DOES NOT happen when simply going to view the page, but only when you edit the page and either cancel and save.

4 answers

1 accepted

0 votes
Answer accepted

This appears to be a known bug, probably introduced in 4.3 https://jira.atlassian.com/browse/CONF-27287 .

The simplest case that I found is to have an HTML macro containing an empty form with an empty (but povided) action:

<form action="">

</form>

Additional data point: this isn't due to the HTML macro -- it also happens when saving one of the page layout templates (e.g., the Global page layout).

is there a registered issue in atlassian's jira project for Confluence???

Found one that seems to be the same. https://jira.atlassian.com/browse/CONF-27287. It does not account for the case I saw where this happens when saving a page layout. It looks like this bug was introduced in 4.3.

Tried to narrow it down as much as possible. So, on a clean confluence to reproduce it you need to add following custom html from Confluence Administration:

1
<a onclick = "f()"/>

Now on any page if you would have inside your content something like:

1
oNcLiCk = "F()

e.g.:

1
blahoNcLiCk = "F()))akldf

when saving, previewing or canceling an edit, you would reproduce this behavior.
If you change at least one character in the match (like remove space before or after =, or make it single quote instead of double quote) - you will be able to save the page properly.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 12, 2019 in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

1,123 views 2 13
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you