BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
e5cc8e0a
Commit
e5cc8e0a
authored
May 18, 2017
by
Robert Speicher
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dm-catch-uri-errors' into 'master'
Catch all URI errors in ExternalLinkFilter Closes #32076 See merge request !11494
parents
12762caf
110f5a16
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletion
+12
-1
dm-catch-uri-errors.yml
changelogs/unreleased/dm-catch-uri-errors.yml
+4
-0
external_link_filter.rb
lib/banzai/filter/external_link_filter.rb
+1
-1
external_link_filter_spec.rb
spec/lib/banzai/filter/external_link_filter_spec.rb
+7
-0
No files found.
changelogs/unreleased/dm-catch-uri-errors.yml
0 → 100644
View file @
e5cc8e0a
---
title
:
Catch all URI errors in ExternalLinkFilter
merge_request
:
author
:
lib/banzai/filter/external_link_filter.rb
View file @
e5cc8e0a
...
...
@@ -24,7 +24,7 @@ module Banzai
def
uri
(
href
)
URI
.
parse
(
href
)
rescue
URI
::
InvalidURI
Error
rescue
URI
::
Error
nil
end
...
...
spec/lib/banzai/filter/external_link_filter_spec.rb
View file @
e5cc8e0a
...
...
@@ -55,6 +55,13 @@ describe Banzai::Filter::ExternalLinkFilter, lib: true do
expect
(
doc
.
to_html
).
to
eq
(
expected
)
end
it
'skips improperly formatted mailtos'
do
doc
=
filter
%q(<p><a href="mailto://jblogs@example.com">Email</a></p>)
expected
=
%q(<p><a href="mailto://jblogs@example.com">Email</a></p>)
expect
(
doc
.
to_html
).
to
eq
(
expected
)
end
end
context
'for links with a username'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment