Skip to content

Commit

Permalink
Escape regexp.
Browse files Browse the repository at this point in the history
  • Loading branch information
ugisozols committed Jan 9, 2012
1 parent 86efe3b commit 7387052
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/refinery/search/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 7387052

Please sign in to comment.