New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compareVersions responder content not HTML escaped #861

Closed
cedclement opened this Issue Jan 19, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@cedclement

cedclement commented Jan 19, 2016

Hello,
The compareVersions responder generates invalid HTML, because the pages content is not escaped.

@amolenaar

This comment has been minimized.

Show comment
Hide comment
@amolenaar

amolenaar Jan 19, 2016

Collaborator

Hi,

Can you provide an example? That would really help in narrowing the issue.

Collaborator

amolenaar commented Jan 19, 2016

Hi,

Can you provide an example? That would really help in narrowing the issue.

@cedclement

This comment has been minimized.

Show comment
Hide comment
@cedclement

cedclement Jan 20, 2016

Yes sure !
For instance, if the content.txt contains a backward search reference link such as <AncestorPage.SomePage, then the diff is truncated before <AncestorPage.SomePage and the browser complains about a missing closing tag.
Looking at the generated html, I can see that the content is not HTML escaped :

<table class="diff_table">   
  <tr>
    <td class="diff_line diff_chunk_header">--- 71b8e94e0f142ecadd0e36f7cfd832d4b058ce49</td>
  </tr>
  <tr>
    <td class="diff_line diff_chunk_header">+++ 88b0eb625fa81a7d1158a588fb86a7b0cb003136</td>
  </tr>
  <tr>
    <td class="diff_line diff_chunk_header">@@ -1,2 +1,2 @@</td>
  </tr>
  <tr>
    <td class="diff_line">Some content</td>
  </tr>
  <tr>
    <td class="diff_line diff_line_removed">-Try a link to <AncestorPage.SomePage </td>
  </tr>
  <tr>
    <td class="diff_line diff_line_added">+Try a link to <AncestorPage.SomePage with more content </td>
  </tr>
</table>

cedclement commented Jan 20, 2016

Yes sure !
For instance, if the content.txt contains a backward search reference link such as <AncestorPage.SomePage, then the diff is truncated before <AncestorPage.SomePage and the browser complains about a missing closing tag.
Looking at the generated html, I can see that the content is not HTML escaped :

<table class="diff_table">   
  <tr>
    <td class="diff_line diff_chunk_header">--- 71b8e94e0f142ecadd0e36f7cfd832d4b058ce49</td>
  </tr>
  <tr>
    <td class="diff_line diff_chunk_header">+++ 88b0eb625fa81a7d1158a588fb86a7b0cb003136</td>
  </tr>
  <tr>
    <td class="diff_line diff_chunk_header">@@ -1,2 +1,2 @@</td>
  </tr>
  <tr>
    <td class="diff_line">Some content</td>
  </tr>
  <tr>
    <td class="diff_line diff_line_removed">-Try a link to <AncestorPage.SomePage </td>
  </tr>
  <tr>
    <td class="diff_line diff_line_added">+Try a link to <AncestorPage.SomePage with more content </td>
  </tr>
</table>

@amolenaar amolenaar added this to the Next release milestone Feb 3, 2016

amolenaar added a commit that referenced this issue Feb 12, 2016

Merge pull request #869 from amolenaar/fix/861
Fix for #861: compareVersions responder is not escaping output.
@amolenaar

This comment has been minimized.

Show comment
Hide comment
@amolenaar

amolenaar Feb 15, 2016

Collaborator

Fixed by #869.

Collaborator

amolenaar commented Feb 15, 2016

Fixed by #869.

@amolenaar amolenaar closed this Feb 15, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment