Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
869d8e81
Commit
869d8e81
authored
Sep 21, 2018
by
Semyon Pupkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix UriDefaultParser cop
parent
2d0839e5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
6 deletions
+1
-6
.rubocop_todo.yml
.rubocop_todo.yml
+0
-5
lib/gitlab/url_sanitizer.rb
lib/gitlab/url_sanitizer.rb
+1
-1
No files found.
.rubocop_todo.yml
View file @
869d8e81
...
...
@@ -130,11 +130,6 @@ Naming/HeredocDelimiterCase:
Naming/HeredocDelimiterNaming
:
Enabled
:
false
# Offense count: 1
# Cop supports --auto-correct.
Performance/UriDefaultParser
:
Exclude
:
-
'
lib/gitlab/url_sanitizer.rb'
# Offense count: 3821
# Configuration parameters: Prefixes.
...
...
lib/gitlab/url_sanitizer.rb
View file @
869d8e81
...
...
@@ -3,7 +3,7 @@ module Gitlab
ALLOWED_SCHEMES
=
%w[http https ssh git]
.
freeze
def
self
.
sanitize
(
content
)
regexp
=
URI
::
Parser
.
new
.
make_regexp
(
ALLOWED_SCHEMES
)
regexp
=
URI
::
DEFAULT_PARSER
.
make_regexp
(
ALLOWED_SCHEMES
)
content
.
gsub
(
regexp
)
{
|
url
|
new
(
url
).
masked_url
}
rescue
Addressable
::
URI
::
InvalidURIError
...
...
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