mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 22:37:37 +08:00
FIX: respect tl3 links no follow
setting (#8232)
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user