summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2017-12-22 23:19:57 -0800
committerStan Hu <stanhu@gmail.com>2017-12-22 23:21:12 -0800
commit0faf772b6cfd691e16d529051a8901627a660a7a (patch)
tree3e890ddd4c2bf3fdd2fccd95e9ebc981941514eb /lib
parent46be07d2c1da93cffd59fb03036e357c04ff6f3b (diff)
downloadgitlab-ce-0faf772b6cfd691e16d529051a8901627a660a7a.tar.gz
Gracefully handle garbled URIs in Markdownsh-catch-invalid-uri-markdown
There are certain inputs that look like valid URIs that are accepted by URI but not Addressable::URI. Handle the case where the latter fails. Closes #41442
Diffstat (limited to 'lib')
-rw-r--r--lib/banzai/filter/relative_link_filter.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/banzai/filter/relative_link_filter.rb b/lib/banzai/filter/relative_link_filter.rb
index c1f933ec54b..5c197afd782 100644
--- a/lib/banzai/filter/relative_link_filter.rb
+++ b/lib/banzai/filter/relative_link_filter.rb
@@ -66,7 +66,7 @@ module Banzai
if uri.relative? && uri.path.present?
html_attr.value = rebuild_relative_uri(uri).to_s
end
- rescue URI::Error
+ rescue URI::Error, Addressable::URI::InvalidURIError
# noop
end