about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--app/models/tag.rb2
-rw-r--r--app/services/account_search_service.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/tag.rb b/app/models/tag.rb
index 0fa08e157..dc2c8d129 100644
--- a/app/models/tag.rb
+++ b/app/models/tag.rb
@@ -23,7 +23,7 @@ class Tag < ApplicationRecord
 
   class << self
     def search_for(term, limit = 5)
-      pattern = sanitize_sql_like(term) + '%'
+      pattern = sanitize_sql_like(term.strip) + '%'
       Tag.where('lower(name) like lower(?)', pattern).order(:name).limit(limit)
     end
   end
diff --git a/app/services/account_search_service.rb b/app/services/account_search_service.rb
index a289ceac4..3be110665 100644
--- a/app/services/account_search_service.rb
+++ b/app/services/account_search_service.rb
@@ -4,7 +4,7 @@ class AccountSearchService < BaseService
   attr_reader :query, :limit, :options, :account
 
   def call(query, limit, account = nil, options = {})
-    @query   = query
+    @query   = query.strip
     @limit   = limit
     @options = options
     @account = account