FIX: in multisite setup, links to the current forum are whitelisted when looking for spam hosts
This commit is contained in:
parent
e88e43bfb6
commit
340fd303c8
|
@ -167,6 +167,7 @@ class Post < ActiveRecord::Base
|
|||
.reject{|h| !h.include?('.')}
|
||||
|
||||
hosts << GlobalSetting.hostname
|
||||
hosts << RailsMultisite::ConnectionManagement.current_hostname
|
||||
|
||||
end
|
||||
|
||||
|
|
|
@ -798,8 +798,7 @@ describe Post do
|
|||
|
||||
describe "has_host_spam" do
|
||||
it "correctly detects host spam" do
|
||||
post = Fabricate(:post, raw: "hello from my site http://www.somesite.com
|
||||
http://#{GlobalSetting.hostname} ")
|
||||
post = Fabricate(:post, raw: "hello from my site http://www.somesite.com http://#{GlobalSetting.hostname} http://#{RailsMultisite::ConnectionManagement.current_hostname}")
|
||||
|
||||
post.total_hosts_usage.should == {"www.somesite.com" => 1}
|
||||
post.acting_user.trust_level = 0
|
||||
|
|
Loading…
Reference in New Issue