mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-18 23:49:42 +00:00
Add support for Gemini urls (#15013)
This PR updates the `valid_url` regex and sanitizer allowlist to provide support for Gemini urls. Closes #14991
This commit is contained in:
parent
4130aef29c
commit
0c24f4dce2
|
@ -18,6 +18,7 @@ class Sanitize
|
||||||
gopher
|
gopher
|
||||||
xmpp
|
xmpp
|
||||||
magnet
|
magnet
|
||||||
|
gemini
|
||||||
).freeze
|
).freeze
|
||||||
|
|
||||||
CLASS_WHITELIST_TRANSFORMER = lambda do |env|
|
CLASS_WHITELIST_TRANSFORMER = lambda do |env|
|
||||||
|
|
|
@ -29,7 +29,7 @@ module Twitter
|
||||||
( # $1 total match
|
( # $1 total match
|
||||||
(#{REGEXEN[:valid_url_preceding_chars]}) # $2 Preceding character
|
(#{REGEXEN[:valid_url_preceding_chars]}) # $2 Preceding character
|
||||||
( # $3 URL
|
( # $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_domain]}) # $5 Domain(s)
|
||||||
(?::(#{REGEXEN[:valid_port_number]}))? # $6 Port number (optional)
|
(?::(#{REGEXEN[:valid_port_number]}))? # $6 Port number (optional)
|
||||||
(/#{REGEXEN[:valid_url_path]}*)? # $7 URL Path and anchor
|
(/#{REGEXEN[:valid_url_path]}*)? # $7 URL Path and anchor
|
||||||
|
|
Loading…
Reference in a new issue