FIX: Count the links in the post

This commit is contained in:
Robin Ward 2018-02-06 20:16:48 -05:00
parent 1bab15c757
commit 016b9cd0e9
1 changed files with 1 additions and 1 deletions

View File

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