From 016b9cd0e9ecc5dbb062909538f69a75413d54e3 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Tue, 6 Feb 2018 20:16:48 -0500 Subject: [PATCH] FIX: Count the links in the post --- lib/validators/post_validator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/validators/post_validator.rb b/lib/validators/post_validator.rb index 354e0738de5..64755e558f0 100644 --- a/lib/validators/post_validator.rb +++ b/lib/validators/post_validator.rb @@ -93,7 +93,7 @@ class Validators::PostValidator < ActiveModel::Validator end def can_post_links_validator(post) - return if acting_user_is_trusted?(post, SiteSetting.min_trust_to_post_links) || private_message?(post) + return if post.link_count === 0 || acting_user_is_trusted?(post, SiteSetting.min_trust_to_post_links) || private_message?(post) post.errors.add(:base, I18n.t(:links_require_trust)) end