##// END OF EJS Templates
HTML escape at app/views/common/_diff.rhtml....
Toshi MARUYAMA -
r6240:f742cef0f157
parent child
Show More
@@ -1,57 +1,57
1 <% diff = Redmine::UnifiedDiff.new(diff, :type => diff_type, :max_lines => Setting.diff_max_lines_displayed.to_i) -%>
1 <% diff = Redmine::UnifiedDiff.new(diff, :type => diff_type, :max_lines => Setting.diff_max_lines_displayed.to_i) -%>
2
2
3 <% diff.each do |table_file| -%>
3 <% diff.each do |table_file| -%>
4 <div class="autoscroll">
4 <div class="autoscroll">
5 <% if diff.diff_type == 'sbs' -%>
5 <% if diff.diff_type == 'sbs' -%>
6 <table class="filecontent">
6 <table class="filecontent">
7 <thead>
7 <thead>
8 <tr><th colspan="4" class="filename"><%=to_utf8 table_file.file_name %></th></tr>
8 <tr><th colspan="4" class="filename"><%=h(to_utf8(table_file.file_name)) %></th></tr>
9 </thead>
9 </thead>
10 <tbody>
10 <tbody>
11 <% table_file.each_line do |spacing, line| -%>
11 <% table_file.each_line do |spacing, line| -%>
12 <% if spacing -%>
12 <% if spacing -%>
13 <tr class="spacing">
13 <tr class="spacing">
14 <th class="line-num">...</th><td></td><th class="line-num">...</th><td></td>
14 <th class="line-num">...</th><td></td><th class="line-num">...</th><td></td>
15 </tr>
15 </tr>
16 <% end -%>
16 <% end -%>
17 <tr>
17 <tr>
18 <th class="line-num"><%= line.nb_line_left %></th>
18 <th class="line-num"><%= line.nb_line_left %></th>
19 <td class="line-code <%= line.type_diff_left %>">
19 <td class="line-code <%= line.type_diff_left %>">
20 <pre><%=to_utf8 line.html_line_left %></pre>
20 <pre><%=to_utf8 line.html_line_left %></pre>
21 </td>
21 </td>
22 <th class="line-num"><%= line.nb_line_right %></th>
22 <th class="line-num"><%= line.nb_line_right %></th>
23 <td class="line-code <%= line.type_diff_right %>">
23 <td class="line-code <%= line.type_diff_right %>">
24 <pre><%=to_utf8 line.html_line_right %></pre>
24 <pre><%=to_utf8 line.html_line_right %></pre>
25 </td>
25 </td>
26 </tr>
26 </tr>
27 <% end -%>
27 <% end -%>
28 </tbody>
28 </tbody>
29 </table>
29 </table>
30
30
31 <% else -%>
31 <% else -%>
32 <table class="filecontent">
32 <table class="filecontent">
33 <thead>
33 <thead>
34 <tr><th colspan="3" class="filename"><%=to_utf8 table_file.file_name %></th></tr>
34 <tr><th colspan="3" class="filename"><%=h(to_utf8(table_file.file_name)) %></th></tr>
35 </thead>
35 </thead>
36 <tbody>
36 <tbody>
37 <% table_file.each_line do |spacing, line| %>
37 <% table_file.each_line do |spacing, line| %>
38 <% if spacing -%>
38 <% if spacing -%>
39 <tr class="spacing">
39 <tr class="spacing">
40 <th class="line-num">...</th><th class="line-num">...</th><td></td>
40 <th class="line-num">...</th><th class="line-num">...</th><td></td>
41 </tr>
41 </tr>
42 <% end -%>
42 <% end -%>
43 <tr>
43 <tr>
44 <th class="line-num"><%= line.nb_line_left %></th>
44 <th class="line-num"><%= line.nb_line_left %></th>
45 <th class="line-num"><%= line.nb_line_right %></th>
45 <th class="line-num"><%= line.nb_line_right %></th>
46 <td class="line-code <%= line.type_diff %>">
46 <td class="line-code <%= line.type_diff %>">
47 <pre><%=to_utf8 line.html_line %></pre>
47 <pre><%=to_utf8 line.html_line %></pre>
48 </td>
48 </td>
49 </tr>
49 </tr>
50 <% end -%>
50 <% end -%>
51 </tbody>
51 </tbody>
52 </table>
52 </table>
53 <% end -%>
53 <% end -%>
54 </div>
54 </div>
55 <% end -%>
55 <% end -%>
56
56
57 <%= l(:text_diff_truncated) if diff.truncated? %>
57 <%= l(:text_diff_truncated) if diff.truncated? %>
General Comments 0
You need to be logged in to leave comments. Login now