mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FIX: nuke spammer from flags page
This commit is contained in:
parent
9545e2e46e
commit
5fd390c600
2 changed files with 5 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue