Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Escape regexp. Closes #13.

  • Loading branch information...
commit 2cd70c61186df1f9cfcce16fb1497ee0838e2b0b 1 parent f579d8f
@ugisozols ugisozols authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  app/views/search/show.html.erb
View
2  app/views/search/show.html.erb
@@ -9,7 +9,7 @@
<span class='result_type'>
<%= result.class.to_s.titleize %>
</span>
- <%= link_to raw(result.title.gsub(/(#{params[:query]})/i,'<mark>\1</mark>')), result_url(result) %>
+ <%= link_to raw(result.title.gsub(/(#{Regexp.escape(params[:query])})/i, '<mark>\1</mark>')), result_url(result) %>
</li>
<% end %>
</ul>
Please sign in to comment.
Something went wrong with that request. Please try again.