diff options
author | Claire <claire.github-309c@sitedethib.com> | 2023-01-05 18:44:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-05 18:44:15 +0100 |
commit | ad17e1944aa4c01c5637199b464c9d78b7e54af2 (patch) | |
tree | dee9d23334a0d23fbc3737e3c17033727805a141 /app/validators/url_validator.rb | |
parent | 7e9d5bdbb9125197afb5b3df69ce49a79451d697 (diff) | |
parent | c4649ae9d4ef34cc0bad9d5df0da8e8b6c729522 (diff) |
Merge pull request #2071 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/validators/url_validator.rb')
-rw-r--r-- | app/validators/url_validator.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/validators/url_validator.rb b/app/validators/url_validator.rb index 75d1edb87..a90fb6958 100644 --- a/app/validators/url_validator.rb +++ b/app/validators/url_validator.rb @@ -10,5 +10,7 @@ class URLValidator < ActiveModel::EachValidator def compliant?(url) parsed_url = Addressable::URI.parse(url) parsed_url && %w(http https).include?(parsed_url.scheme) && parsed_url.host + rescue Addressable::URI::InvalidURIError + false end end |