From 28212bd2beaf89bbe89793c354d083c11e0e6ed7 Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 31 May 2022 18:25:24 +0200 Subject: [PATCH] Fix TagManager#local_url? erroring out on invalid URL (#18580) --- app/lib/tag_manager.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/lib/tag_manager.rb b/app/lib/tag_manager.rb index 39a98c3eb9..a1d12a654e 100644 --- a/app/lib/tag_manager.rb +++ b/app/lib/tag_manager.rb @@ -24,8 +24,11 @@ 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) + rescue Addressable::URI::InvalidURIError + false end end