FIX: in multisite setup, links to the current forum are whitelisted when looking for spam hosts

This commit is contained in:
Neil Lalonde 2014-04-28 10:37:28 -04:00
parent e88e43bfb6
commit 340fd303c8
2 changed files with 2 additions and 2 deletions

View File

@ -167,6 +167,7 @@ class Post < ActiveRecord::Base
.reject{|h| !h.include?('.')}
hosts << GlobalSetting.hostname
hosts << RailsMultisite::ConnectionManagement.current_hostname
end

View File

@ -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