mirror of
https://github.com/discourse/discourse.git
synced 2025-03-06 03:09:43 +00: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
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return write_attribute(:ip_address, val) if val.is_a?(IPAddr)
|
||||||
|
|
||||||
num_wildcards = val.count('*')
|
num_wildcards = val.count('*')
|
||||||
if num_wildcards == 0
|
if num_wildcards == 0
|
||||||
write_attribute(:ip_address, val)
|
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.12.12", "210.56.12.12")
|
||||||
test_good_value("210.56.0.0/16", "210.56.0.0/16")
|
test_good_value("210.56.0.0/16", "210.56.0.0/16")
|
||||||
test_good_value("fc00::/7", "fc00::/7")
|
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
|
end
|
||||||
|
|
||||||
it "translates * characters" do
|
it "translates * characters" do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user