Fix allow with approval option not working on username blocks (#35655)
This commit is contained in:
@@ -43,7 +43,7 @@ class UsernameBlock < ApplicationRecord
|
|||||||
|
|
||||||
def self.matches?(str, allow_with_approval: false)
|
def self.matches?(str, allow_with_approval: false)
|
||||||
normalized_str = str.downcase.gsub(Regexp.union(HOMOGLYPHS.keys), HOMOGLYPHS)
|
normalized_str = str.downcase.gsub(Regexp.union(HOMOGLYPHS.keys), HOMOGLYPHS)
|
||||||
where(allow_with_approval: allow_with_approval).matches_exactly(normalized_str).or(matches_partially(normalized_str)).any?
|
matches_exactly(normalized_str).or(matches_partially(normalized_str)).where(allow_with_approval: allow_with_approval).any?
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_log_human_identifier
|
def to_log_human_identifier
|
||||||
|
|||||||
Reference in New Issue
Block a user