1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00

Fix not being able to invoke phrase search using unicode quotation marks (#26687)

This commit is contained in:
Eugen Rochko 2023-09-01 09:27:03 +02:00 committed by GitHub
parent 0008458128
commit 872145d1c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,8 +1,10 @@
# frozen_string_literal: true # frozen_string_literal: true
class SearchService < BaseService class SearchService < BaseService
QUOTE_EQUIVALENT_CHARACTERS = /[“”„«»「」『』《》]/
def call(query, account, limit, options = {}) def call(query, account, limit, options = {})
@query = query&.strip @query = query&.strip&.gsub(QUOTE_EQUIVALENT_CHARACTERS, '"')
@account = account @account = account
@options = options @options = options
@limit = limit.to_i @limit = limit.to_i