about summary refs log tree commit diff
path: root/app/lib/tag_manager.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/tag_manager.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/tag_manager.rb')
-rw-r--r--app/lib/tag_manager.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/lib/tag_manager.rb b/app/lib/tag_manager.rb
index d06bea059..29dde128c 100644
--- a/app/lib/tag_manager.rb
+++ b/app/lib/tag_manager.rb
@@ -32,6 +32,7 @@ class TagManager
 
   def local_url?(url)
     uri    = Addressable::URI.parse(url).normalize
+    return false unless uri.host
     domain = uri.host + (uri.port ? ":#{uri.port}" : '')
 
     TagManager.instance.web_domain?(domain)