mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 05:31:14 +08:00
FIX: Make sure rel attributes are correctly set. (#10645)
We must guarantee that "rel=noopener" was set if "target=_blank" is present, which is not always the case for trusted users. Also, if the link contains the "nofollow" attribute, it has to have the "ugc" attribute as well.
This commit is contained in:
@ -656,9 +656,8 @@ class CookedPostProcessor
|
||||
end
|
||||
|
||||
def enforce_nofollow
|
||||
if !@omit_nofollow && SiteSetting.add_rel_nofollow_to_user_content
|
||||
PrettyText.add_rel_nofollow_to_user_content(@doc)
|
||||
end
|
||||
add_nofollow = !@omit_nofollow && SiteSetting.add_rel_nofollow_to_user_content
|
||||
PrettyText.add_rel_attributes_to_user_content(@doc, add_nofollow)
|
||||
end
|
||||
|
||||
def pull_hotlinked_images
|
||||
|
Reference in New Issue
Block a user