From f2b2614d0a3852259f21f7969a946fb3d8b7e96d Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 11 Apr 2022 08:40:18 +0200 Subject: Fix link sanitization for outgoing text/html and text/markdown toots Fixes #1739 --- lib/sanitize_ext/sanitize_config.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/sanitize_ext') diff --git a/lib/sanitize_ext/sanitize_config.rb b/lib/sanitize_ext/sanitize_config.rb index 935e1f4f6..946543868 100644 --- a/lib/sanitize_ext/sanitize_config.rb +++ b/lib/sanitize_ext/sanitize_config.rb @@ -133,7 +133,7 @@ class Sanitize rel += ['nofollow', 'noopener', 'noreferrer'] unless TagManager.instance.local_url?(node['href']) if rel.empty? - node['rel']&.delete + node.remove_attribute('rel') else node['rel'] = rel.join(' ') end @@ -144,7 +144,7 @@ class Sanitize node = env[:node] if node['target'] != '_blank' && TagManager.instance.local_url?(node['href']) - node['target']&.delete + node.remove_attribute('target') else node['target'] = '_blank' end -- cgit