mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 01:16:38 -06:00
FIX: nuke spammer from flags page
This commit is contained in:
parent
9545e2e46e
commit
5fd390c600
@ -23,6 +23,8 @@ class ScreenedIpAddress < ActiveRecord::Base
|
||||
return
|
||||
end
|
||||
|
||||
return write_attribute(:ip_address, val) if val.is_a?(IPAddr)
|
||||
|
||||
num_wildcards = val.count('*')
|
||||
if num_wildcards == 0
|
||||
write_attribute(:ip_address, val)
|
||||
|
@ -66,6 +66,9 @@ describe ScreenedIpAddress do
|
||||
test_good_value("210.56.12.12", "210.56.12.12")
|
||||
test_good_value("210.56.0.0/16", "210.56.0.0/16")
|
||||
test_good_value("fc00::/7", "fc00::/7")
|
||||
test_good_value(IPAddr.new("94.99.101.228"), "94.99.101.228")
|
||||
test_good_value(IPAddr.new("94.99.0.0/16"), "94.99.0.0/16")
|
||||
test_good_value(IPAddr.new("fc00::/7"), "fc00::/7")
|
||||
end
|
||||
|
||||
it "translates * characters" do
|
||||
|
Loading…
Reference in New Issue
Block a user