A platform for community discussion. Free, open, simple.
FIX: Count the links in the post
Robin Ward016b9cd0e9ec
diff --git a/lib/validators/post_validator.rb b/lib/validators/post_validator.rbindex 354e0738de5..64755e558f0 100644--- a/lib/validators/post_validator.rb+++ b/lib/validators/post_validator.rb@@ -93,7 +93,7 @@ class Validators::PostValidator < ActiveModel::Validatorenddef 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