Browse Source

Make account domains case-insensitive, downcase before checking against local

closed-social-glitch-2
Eugen Rochko 7 years ago
parent
commit
aec51e40ee
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      app/lib/tag_manager.rb
  2. +1
    -1
      app/models/account.rb

+ 1
- 1
app/lib/tag_manager.rb View File

@ -18,7 +18,7 @@ class TagManager
end
def local_domain?(domain)
domain.nil? || domain.gsub(/[\/]/, '') == Rails.configuration.x.local_domain
domain.nil? || domain.gsub(/[\/]/, '').downcase == Rails.configuration.x.local_domain.downcase
end
def uri_for(target)

+ 1
- 1
app/models/account.rb View File

@ -125,7 +125,7 @@ class Account < ApplicationRecord
end
def self.find_remote!(username, domain)
where(arel_table[:username].matches(username)).where(domain: domain).take!
where(arel_table[:username].matches(username)).where(domain.nil? ? { domain: nil } : arel_table[:domain].matches(domain)).take!
end
def self.find_local(username)

Loading…
Cancel
Save