Skip to content

Commit

Permalink
search_controller.rb: unregistered users may not use LIKE
Browse files Browse the repository at this point in the history
  • Loading branch information
user12986714 committed Jun 21, 2020
1 parent 88b6421 commit a3ceed2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/search_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def index
end
end

if ['LIKE', 'NOT LIKE'].include?(body_operation) && user_signed_in? && params[:body_is_like] != '1' && body.present?
if ['LIKE', 'NOT LIKE'].include?(body_operation) && params[:body_is_like] != '1' && body.present?
# If the operation would be LIKE, hijack it and use our fulltext index for a search instead.
# UNLESS... params[:body_is_like] is set, in which case the user has explicitly specified a LIKE query.
@results = @results.match_search(body, with_search_score: false, posts: :body)
Expand Down

0 comments on commit a3ceed2

Please sign in to comment.