From 75cc1421a3613c34e6c02cdb8033b686ccd8e135 Mon Sep 17 00:00:00 2001 From: evazion Date: Fri, 30 Mar 2018 22:24:34 -0500 Subject: [PATCH] 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. --- app/models/wiki_page.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb index 8b38e085d..8b772e962 100644 --- a/app/models/wiki_page.rb +++ b/app/models/wiki_page.rb @@ -67,7 +67,7 @@ class WikiPage < ApplicationRecord q = super 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 if params[:creator_id].present?