When looking up fediverse urls, verify that account results returned match the input query. (#3341)

Fixes #2804
This commit is contained in:
Levi Bard 2023-02-25 21:27:26 +01:00 committed by GitHub
commit 2e189a17dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 3 deletions

View file

@ -86,8 +86,11 @@ abstract class BottomSheetActivity : BaseActivity() {
if (statuses.isNotEmpty()) {
viewThread(statuses[0].id, statuses[0].url)
return@subscribe
} else if (accounts.isNotEmpty()) {
viewAccount(accounts[0].id)
}
accounts.firstOrNull { it.url == url }?.let { account ->
// Some servers return (unrelated) accounts for url searches (#2804)
// Verify that the account's url matches the query
viewAccount(account.id)
return@subscribe
}