Fix accounts search by full/partial display name and others (#11580)

- Restrict followers counts to local users to minimize local advantage
- Fix emoji shortcodes causing error in search
- Fix search syntax parse errors not being caught
This commit is contained in:
Eugen Rochko
2019-08-16 13:00:30 +02:00
committed by GitHub
parent 6e872c6dab
commit 70da6d6630
5 changed files with 25 additions and 15 deletions

View File

@ -75,6 +75,8 @@ class SearchQueryTransformer < Parslet::Transform
if clause[:term]
TermClause.new(prefix, operator, clause[:term].to_s)
elsif clause[:shortcode]
TermClause.new(prefix, operator, ":#{clause[:term]}:")
elsif clause[:phrase]
PhraseClause.new(prefix, operator, clause[:phrase].map { |p| p[:term].to_s }.join(' '))
else