lib/inquisitio/search_url_builder.rb in inquisitio-1.1.1 vs lib/inquisitio/search_url_builder.rb in inquisitio-1.1.2
- old
+ new
@@ -22,11 +22,11 @@
components.join("")
end
private
def simple_query
- "q=#{URI.encode(@query.first.gsub('\'',''))}"
+ "q=#{URI.encode(sanitise(@query.first)).gsub('&', '%26')}"
end
def boolean_query
query_blocks = []
@@ -47,14 +47,14 @@
else
raise InquisitioError.new("Filter values must be strings or arrays.")
end
end
- "bq=#{URI.encode("(and #{query_blocks.join(' ')})")}"
+ "bq=#{URI.encode("(and #{query_blocks.join(' ')})").gsub('&', '%26')}"
end
def sanitise(value)
- value.to_s.gsub('\'','');
+ value.to_s.gsub('\'','')
end
def return_fields_query_string
return "" if @return_fields.nil?
"&return-fields=#{URI::encode(@return_fields.join(',').gsub('\'',''))}"