mirror of
https://github.com/discourse/discourse.git
synced 2025-02-07 20:08:26 +00:00
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?('.')}
|
.reject{|h| !h.include?('.')}
|
||||||
|
|
||||||
hosts << GlobalSetting.hostname
|
hosts << GlobalSetting.hostname
|
||||||
|
hosts << RailsMultisite::ConnectionManagement.current_hostname
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -798,8 +798,7 @@ describe Post do
|
|||||||
|
|
||||||
describe "has_host_spam" do
|
describe "has_host_spam" do
|
||||||
it "correctly detects host spam" do
|
it "correctly detects host spam" do
|
||||||
post = Fabricate(:post, raw: "hello from my site http://www.somesite.com
|
post = Fabricate(:post, raw: "hello from my site http://www.somesite.com http://#{GlobalSetting.hostname} http://#{RailsMultisite::ConnectionManagement.current_hostname}")
|
||||||
http://#{GlobalSetting.hostname} ")
|
|
||||||
|
|
||||||
post.total_hosts_usage.should == {"www.somesite.com" => 1}
|
post.total_hosts_usage.should == {"www.somesite.com" => 1}
|
||||||
post.acting_user.trust_level = 0
|
post.acting_user.trust_level = 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user