about summary refs log tree commit diff
path: root/app/validators
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2023-01-05 14:16:25 +0100
committerClaire <claire.github-309c@sitedethib.com>2023-01-05 14:16:25 +0100
commit6c20dad201efdfaec59c37ce3f3ca4c7702b5274 (patch)
treeb1df234db04b93b7d0c241d120019f03368850f4 /app/validators
parent7e9d5bdbb9125197afb5b3df69ce49a79451d697 (diff)
parent18d00055f4f7e28a9a4cc81d3159072e9beb779d (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `README.md`:
  Upstream updated its README, while we have a completely different one.
  Kept our README.
- `app/controllers/concerns/web_app_controller_concern.rb`:
  Conflict because of glitch-soc's theming system.
  Additionally, glitch-soc has different behavior regarding moved accounts.
  Ported some of the changes, but kept our overall behavior.
- `app/javascript/packs/admin.js`:
  Code changes actually applied to `app/javascript/core/admin.js`
Diffstat (limited to 'app/validators')
-rw-r--r--app/validators/url_validator.rb2
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