Escape message titles and bodies. This is an emergency fix as some genius

has decided to report this XSS problem to a public mailing list. Unfortunately
it means that some functionality (links in messages etc) has been lost for now.
This commit is contained in:
Tom Hughes 2008-01-15 00:26:01 +00:00
parent bc309badb8
commit 1e54573bae
2 changed files with 6 additions and 6 deletions

View file

@ -1,5 +1,5 @@
<b><%= diary_entry.title %></b><br />
<%= simple_format(diary_entry.body) %>
<b><%= h(diary_entry.title) %></b><br />
<%= simple_format(h(diary_entry.body)) %>
<% if diary_entry.latitude and diary_entry.longitude %>
Coordinates: <div class="geo" style="display: inline"><span class="latitude"><%= diary_entry.latitude %></span>; <span class="longitude"><%= diary_entry.longitude %></span></div> (<%=link_to 'map', :controller => 'site', :action => 'index', :lat => diary_entry.latitude, :lon => diary_entry.longitude, :zoom => 14 %> / <%=link_to 'edit', :controller => 'site', :action => 'edit', :lat => diary_entry.latitude, :lon => diary_entry.longitude, :zoom => 14 %>)<br/>
<% end %>

View file

@ -9,7 +9,7 @@
</tr>
<tr>
<th align="right">Subject</th>
<td><%= @message.title %></td>
<td><%= h(@message.title) %></td>
</tr>
<tr>
<th align="right">Date</th>
@ -17,7 +17,7 @@
</tr>
<tr>
<th></th>
<td><%= @message.body %></td>
<td><%= h(@message.body) %></td>
</tr>
</table>
@ -42,7 +42,7 @@
</tr>
<tr>
<th align="right">Subject</th>
<td><%= @message.title %></td>
<td><%= h(@message.title) %></td>
</tr>
<tr>
<th align="right">Date</th>
@ -50,7 +50,7 @@
</tr>
<tr>
<th></th>
<td><%= @message.body %></td>
<td><%= h(@message.body) %></td>
</tr>
</table>