diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2019-07-09 03:27:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-09 03:27:35 +0200 |
commit | 4e921832272425352d28cad550bfc4dffd6d0e78 (patch) | |
tree | c315a0b9dda8b69b6512c79711e896a18756f701 /app/lib | |
parent | 1e7187f2a8e0b9ffe4e7d6b06e9f70674c50471e (diff) |
Refactor domain block checks (#11268)
Diffstat (limited to 'app/lib')
-rw-r--r-- | app/lib/tag_manager.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/lib/tag_manager.rb b/app/lib/tag_manager.rb index daf4f556b..c88cf4994 100644 --- a/app/lib/tag_manager.rb +++ b/app/lib/tag_manager.rb @@ -24,13 +24,16 @@ class TagManager def same_acct?(canonical, needle) return true if canonical.casecmp(needle).zero? + username, domain = needle.split('@') + local_domain?(domain) && canonical.casecmp(username).zero? end def local_url?(url) uri = Addressable::URI.parse(url).normalize domain = uri.host + (uri.port ? ":#{uri.port}" : '') + TagManager.instance.web_domain?(domain) end end |