Commit 54a50bf8 authored by James Lopez's avatar James Lopez
Browse files

refactor url validator to use sanitizer for check

parent 26ce833a
...@@ -35,9 +35,7 @@ def valid_url?(value) ...@@ -35,9 +35,7 @@ def valid_url?(value)
end end
def valid_uri?(value) def valid_uri?(value)
Addressable::URI.parse(value).is_a?(Addressable::URI) Gitlab::UrlSanitizer.valid?(value)
rescue Addressable::URI::InvalidURIError
false
end end
def valid_protocol?(value) def valid_protocol?(value)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment