about summary refs log tree commit diff
path: root/app/lib/sanitize_config.rb
diff options
context:
space:
mode:
authorBen Lubar <github@lubar.me>2020-05-28 05:47:40 -0500
committerGitHub <noreply@github.com>2020-05-28 12:47:40 +0200
commitead09f5ddc73034fcd573b459868dd1ca13b647a (patch)
treeed2f828f33f44268a05377b6907f7af37d253677 /app/lib/sanitize_config.rb
parentc8cee24cb34fadf5d3887346f5b9333e0036adf6 (diff)
Fix exception when trying to serialize posts with <a> tags in them without hrefs (#1334)
* fix exception when trying to serialize posts with <a> tags in them without hrefs

* Add tests

Co-authored-by: Thibaut Girka <thib@sitedethib.com>
Diffstat (limited to 'app/lib/sanitize_config.rb')
-rw-r--r--app/lib/sanitize_config.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/lib/sanitize_config.rb b/app/lib/sanitize_config.rb
index 34793ed93..dfd8b9f91 100644
--- a/app/lib/sanitize_config.rb
+++ b/app/lib/sanitize_config.rb
@@ -55,7 +55,7 @@ class Sanitize
     end
 
     LINK_REL_TRANSFORMER = lambda do |env|
-      return unless env[:node_name] == 'a'
+      return unless env[:node_name] == 'a' and env[:node]['href']
 
       node = env[:node]