Fix #3590: Superfluous space added on certain autocompletions.
Bug: searching for /wiki_pages?search[title]=touhou%20 didn't find the 'touhou' wiki. The space wasn't stripped when the title was normalized.
This commit is contained in:
@@ -67,7 +67,7 @@ class WikiPage < ApplicationRecord
|
|||||||
q = super
|
q = super
|
||||||
|
|
||||||
if params[:title].present?
|
if params[:title].present?
|
||||||
q = q.where("title LIKE ? ESCAPE E'\\\\'", params[:title].mb_chars.downcase.tr(" ", "_").to_escaped_for_sql_like)
|
q = q.where("title LIKE ? ESCAPE E'\\\\'", params[:title].mb_chars.downcase.strip.tr(" ", "_").to_escaped_for_sql_like)
|
||||||
end
|
end
|
||||||
|
|
||||||
if params[:creator_id].present?
|
if params[:creator_id].present?
|
||||||
|
|||||||
Reference in New Issue
Block a user