FIX: respect tl3 links no follow setting (#8232)

This commit is contained in:
Arpit Jalan
2019-10-22 22:41:04 +05:30
committed by GitHub
parent 51ecbeef4d
commit 1e9d9d9346
2 changed files with 38 additions and 2 deletions

View File

@ -28,6 +28,7 @@ class CookedPostProcessor
@size_cache = {}
@disable_loading_image = !!opts[:disable_loading_image]
@omit_nofollow = post.omit_nofollow?
end
def post_process(bypass_bump: false, new_post: false)
@ -580,7 +581,7 @@ class CookedPostProcessor
end
end
if @cooking_options[:omit_nofollow] || !SiteSetting.add_rel_nofollow_to_user_content
if @omit_nofollow || !SiteSetting.add_rel_nofollow_to_user_content
@doc.css(".onebox-body a, .onebox a").each { |a| a.remove_attribute("rel") }
end
end
@ -617,7 +618,7 @@ class CookedPostProcessor
end
def enforce_nofollow
if !@cooking_options[:omit_nofollow] && SiteSetting.add_rel_nofollow_to_user_content
if !@omit_nofollow && SiteSetting.add_rel_nofollow_to_user_content
PrettyText.add_rel_nofollow_to_user_content(@doc)
end
end