diff --git a/lib/validators/post_validator.rb b/lib/validators/post_validator.rb index 81d6a844864..f0b7b54a014 100644 --- a/lib/validators/post_validator.rb +++ b/lib/validators/post_validator.rb @@ -16,7 +16,6 @@ class Validators::PostValidator < ActiveModel::Validator max_images_validator(record) max_attachments_validator(record) can_post_links_validator(record) - newuser_links_validator(record) unique_post_validator(record) end @@ -110,10 +109,13 @@ class Validators::PostValidator < ActiveModel::Validator end def can_post_links_validator(post) - return if (post.link_count == 0 && !post.has_oneboxes?) || + if (post.link_count == 0 && !post.has_oneboxes?) || Guardian.new(post.acting_user).can_post_link? || private_message?(post) + return newuser_links_validator(post) + end + post.errors.add(:base, I18n.t(:links_require_trust)) end