Permalink
Browse files

Escape regexp.

  • Loading branch information...
1 parent 86efe3b commit 738705263cc628c457f5179fd2dbf59f39b47cf3 @ugisozols ugisozols committed Jan 9, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/views/refinery/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>

0 comments on commit 7387052

Please sign in to comment.