1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:07:52 +08:00

Fix link protocol allowlist allowing too much

This commit is contained in:
Bartłomiej Dach 2023-09-18 09:20:14 +02:00
parent a2df123c6d
commit d3cc6dbaa0
No known key found for this signature in database

View File

@ -28,7 +28,7 @@ namespace osu.Game.Online.Chat
// http[s]://<domain>.<tld>[:port][/path][?query][#fragment]
private static readonly Regex advanced_link_regex = new Regex(
// protocol
@"(?<link>(https?|osu)[a-z]*?:\/\/" +
@"(?<link>(https?|osu(mp)?):\/\/" +
// domain + tld
@"(?<domain>(?:[a-z0-9]\.|[a-z0-9][a-z0-9-]*[a-z0-9]\.)*[a-z0-9-]*[a-z0-9]" +
// port (optional)