forked from cybrespace/mastodon
Fix search API not resolving URL when type is given (#11822)
Fix #11771
This commit is contained in:
parent
0762258aec
commit
50edf84898
|
@ -11,7 +11,7 @@ class SearchService < BaseService
|
||||||
|
|
||||||
default_results.tap do |results|
|
default_results.tap do |results|
|
||||||
if url_query?
|
if url_query?
|
||||||
results.merge!(url_resource_results) unless url_resource.nil?
|
results.merge!(url_resource_results) unless url_resource.nil? || (@options[:type].present? && url_resource_symbol != @options[:type].to_sym)
|
||||||
elsif @query.present?
|
elsif @query.present?
|
||||||
results[:accounts] = perform_accounts_search! if account_searchable?
|
results[:accounts] = perform_accounts_search! if account_searchable?
|
||||||
results[:statuses] = perform_statuses_search! if full_text_searchable?
|
results[:statuses] = perform_statuses_search! if full_text_searchable?
|
||||||
|
@ -69,7 +69,7 @@ class SearchService < BaseService
|
||||||
end
|
end
|
||||||
|
|
||||||
def url_query?
|
def url_query?
|
||||||
@resolve && @options[:type].blank? && @query =~ /\Ahttps?:\/\//
|
@resolve && @query =~ /\Ahttps?:\/\//
|
||||||
end
|
end
|
||||||
|
|
||||||
def url_resource_results
|
def url_resource_results
|
||||||
|
|
Loading…
Reference in New Issue