0
0
Fork 0

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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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