Permalink
Browse files

Fix escaping of query on search.

  • Loading branch information...
1 parent c3ae0b0 commit 69c34f27d07d460e8bb861206daf4e21e157705d @andlima andlima committed Nov 18, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/support/search.rb
View
@@ -43,6 +43,8 @@ def self.query(q, options = {})
types = [:user, :question, :topic] & (options[:in] || [])
+ q = CGI.escape(q)
+
# Decide whether to filter the result by type.
if types.present? && types.length != 3
q = "(#{q}) AND entry\\_type:(" +
@@ -53,7 +55,7 @@ def self.query(q, options = {})
per_page = options[:per_page] || 25
start = (page - 1) * per_page
- query_path = "/solr/select?wt=json&q=#{CGI.escape(q)}&start=#{start}" +
+ query_path = "/solr/select?wt=json&q=#{q}&start=#{start}" +
"&rows=#{per_page}"
solr_response_raw =

0 comments on commit 69c34f2

Please sign in to comment.