From d65a252915fc66180786a2877810ab87fed33358 Mon Sep 17 00:00:00 2001 From: Outfluencer <48880402+Outfluencer@users.noreply.github.com> Date: Mon, 5 Aug 2024 10:26:34 +0200 Subject: [PATCH 1/2] TLD can be 24 chars and can contain "-" List of all tlds can be found here (the longest is 24 chars) http://data.iana.org/TLD/tlds-alpha-by-domain.txt example domain that has an online website https://whois.nic.xn--vermgensberatung-pwb/ --- chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java b/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java index 0971a384c7..0635325e2e 100644 --- a/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java +++ b/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java @@ -18,7 +18,7 @@ public final class TextComponent extends BaseComponent { - private static final Pattern url = Pattern.compile( "^(?:(https?)://)?([-\\w_\\.]{2,}\\.[a-z]{2,4})(/\\S*)?$" ); + private static final Pattern url = Pattern.compile( "^(?:(https?)://)?([-\\w_\\.]{2,}\\.[a-z-]{2,24})(/\\S*)?$" ); /** * Converts the old formatting system that used From b527c44779b723ce5407019cbe397329769e6acf Mon Sep 17 00:00:00 2001 From: Outfluencer <48880402+Outfluencer@users.noreply.github.com> Date: Mon, 5 Aug 2024 14:07:09 +0200 Subject: [PATCH 2/2] only increase if matched with http(s) --- chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java b/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java index 0635325e2e..ec63a4cb22 100644 --- a/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java +++ b/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java @@ -18,7 +18,7 @@ public final class TextComponent extends BaseComponent { - private static final Pattern url = Pattern.compile( "^(?:(https?)://)?([-\\w_\\.]{2,}\\.[a-z-]{2,24})(/\\S*)?$" ); + private static final Pattern url = Pattern.compile( "^(?:https?://([-\\w_\\.]+\\.[a-z-]{2,24})|([-\\w_\\.]{2,}\\.[a-z]{2,4}))(/\\S*)?$" ); /** * Converts the old formatting system that used