diff options
author | Josh Leeb-du Toit <mail@joshleeb.com> | 2020-10-20 02:02:13 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-19 17:02:13 +0200 |
commit | 0c24f4dce204e898fe07f763d48f133214d96017 (patch) | |
tree | ef53290e726597c1ea7c9f71f2fdf6f6b66d0b26 | |
parent | 4130aef29cb913cc33a1abaf997955fbbfdeb3b4 (diff) |
Add support for Gemini urls (#15013)
This PR updates the `valid_url` regex and sanitizer allowlist to provide support for Gemini urls. Closes #14991
-rw-r--r-- | app/lib/sanitize_config.rb | 1 | ||||
-rw-r--r-- | config/initializers/twitter_regex.rb | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/app/lib/sanitize_config.rb b/app/lib/sanitize_config.rb index 4ad1199a6..8f700197b 100644 --- a/app/lib/sanitize_config.rb +++ b/app/lib/sanitize_config.rb @@ -18,6 +18,7 @@ class Sanitize gopher xmpp magnet + gemini ).freeze CLASS_WHITELIST_TRANSFORMER = lambda do |env| diff --git a/config/initializers/twitter_regex.rb b/config/initializers/twitter_regex.rb index f84f7c0cb..7f99a0005 100644 --- a/config/initializers/twitter_regex.rb +++ b/config/initializers/twitter_regex.rb @@ -29,7 +29,7 @@ module Twitter ( # $1 total match (#{REGEXEN[:valid_url_preceding_chars]}) # $2 Preceding character ( # $3 URL - ((?:https?|dat|dweb|ipfs|ipns|ssb|gopher):\/\/)? # $4 Protocol (optional) + ((?:https?|dat|dweb|ipfs|ipns|ssb|gopher|gemini):\/\/)? # $4 Protocol (optional) (#{REGEXEN[:valid_domain]}) # $5 Domain(s) (?::(#{REGEXEN[:valid_port_number]}))? # $6 Port number (optional) (/#{REGEXEN[:valid_url_path]}*)? # $7 URL Path and anchor |