diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2016-06-18 14:10:40 +0530 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2016-06-18 14:10:40 +0530 |
commit | 6d169d36cabda783116bcb8e2e6f73254566a670 (patch) | |
tree | aa06e870279b96dcfb3c489d65b06bad70d60dfa /lib | |
parent | 00906b5bb6cde8cb60281109060a519a54000c61 (diff) | |
download | gitlab-ce-6d169d36cabda783116bcb8e2e6f73254566a670.tar.gz |
Fix bug in `WikiLinkFilter`.18819-wiki-link-filter-exception
1. An exception would be raised if the filter was called with an invalid
URI. Mainly because we weren't catching the `Addressable` exception.
2. This commit fixes it and adds a spec for the filter.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/banzai/filter/wiki_link_filter.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/banzai/filter/wiki_link_filter.rb b/lib/banzai/filter/wiki_link_filter.rb index 37a2779d453..1bb6d6bba87 100644 --- a/lib/banzai/filter/wiki_link_filter.rb +++ b/lib/banzai/filter/wiki_link_filter.rb @@ -29,7 +29,7 @@ module Banzai return if html_attr.blank? html_attr.value = apply_rewrite_rules(html_attr.value) - rescue URI::Error + rescue URI::Error, Addressable::URI::InvalidURIError # noop end |