Defect #11209

Wiki diff may generate broken HTML

Added by Kouhei Sutou over 5 years ago. Updated over 5 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Wiki
Target version:2.0.4
Resolution:Fixed Affected version:2.0.3

Description

If Wiki diff has a new line (not a changed line), diff page may generates broken HTML like:

<div class="text-diff">
h1. CookBook documentation 
<br /> Some updated [[documentation]] here... <span class="diff_in">
<br /> More contents...&lt;/span&gt;
</div>

Close </span> tag is escaped.

For example:

Before

h1. CookBook documentation
Some updated [[documentation]] here...

After:

h1. CookBook documentation
Some updated [[documentation]] here...
More contents...

"More contents..." line is added. This case, diff page generates broken HTML.

0001-Fix-too-escaped-span-in-diff-page-for-Wiki-11209.patch Magnifier (3.91 KB) Kouhei Sutou, 2012-06-20 17:30


Related issues

Duplicated by Redmine - Defect #11735: Weird diffs in wiki pages. Closed

Associated revisions

Revision 9895
Added by Jean-Philippe Lang over 5 years ago

Fixed that wiki diff may produce html (#11209).

History

#1 Updated by Kouhei Sutou over 5 years ago

I attach a patch and test case for this issue.
It adds a new fixture data. So it may break other tests. I only tested this patch against test/functional/wiki_controller_test.rb. Sorry.

#2 Updated by Jean-Philippe Lang over 5 years ago

  • Status changed from New to Confirmed

#3 Updated by Jean-Philippe Lang over 5 years ago

  • Subject changed from diff page for Wiki may generate broken HTML to Wiki diff may generate broken HTML
  • Status changed from Confirmed to Resolved
  • Assignee set to Jean-Philippe Lang
  • Target version set to 2.0.4
  • Resolution set to Fixed

Fixed in r9895 with slight changes, thanks for digging into this.

#4 Updated by Kouhei Sutou over 5 years ago

Thanks!

I've also found a similar problem in Wiki update notification mail. I'll submit a new ticket with test case later.

#5 Updated by Jean-Philippe Lang over 5 years ago

  • Status changed from Resolved to Closed

Merged.

Also available in: Atom PDF