diff options
author | James Lopez <james@jameslopez.es> | 2016-07-01 09:02:45 +0200 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-07-01 09:02:45 +0200 |
commit | 54a50bf81d7bb304adaedffd8eb3e0bc0fc348a9 (patch) | |
tree | 7d59f607060867ad83cd60eabb39e67c3018ddb4 /app/validators | |
parent | 26ce833a2143485bb0485c8b01d78561adf7c86d (diff) | |
download | gitlab-ce-54a50bf81d7bb304adaedffd8eb3e0bc0fc348a9.tar.gz |
refactor url validator to use sanitizer for checkfix/import-url-validator
Diffstat (limited to 'app/validators')
-rw-r--r-- | app/validators/addressable_url_validator.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/app/validators/addressable_url_validator.rb b/app/validators/addressable_url_validator.rb index 63761c81721..09bfa613cbe 100644 --- a/app/validators/addressable_url_validator.rb +++ b/app/validators/addressable_url_validator.rb @@ -35,9 +35,7 @@ class AddressableUrlValidator < ActiveModel::EachValidator end def valid_uri?(value) - Addressable::URI.parse(value).is_a?(Addressable::URI) - rescue Addressable::URI::InvalidURIError - false + Gitlab::UrlSanitizer.valid?(value) end def valid_protocol?(value) |