diff --git a/app/views/repositories/diff.rhtml b/app/views/repositories/diff.rhtml
index efb84a44d..cb868665a 100644
--- a/app/views/repositories/diff.rhtml
+++ b/app/views/repositories/diff.rhtml
@@ -16,7 +16,7 @@
<%= f.link_to 'Diff', :url => params, :caption => 'Unified diff' %>
<% end %>
-<% html_title(with_leading_slash(@path), 'Diff') -%>
+<% html_title(h(with_leading_slash(@path)), 'Diff') -%>
<% content_for :header_tags do %>
<%= stylesheet_link_tag "scm" %>