mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-13 16:54:22 +00:00
Fix url regex (#2815)
Fixed url detection in chat messages. Stops false positives such as `um.....no`
This commit is contained in:
1 parent
aa672ea69a
commit
5f74a75435
1 file changed
+3
-3
@@ -561,9 +561,9 @@ public class ForgeHooks
|
||||
|
||||
|
||||
static final Pattern URL_PATTERN = Pattern.compile(
|
||||
// schema ipv4 OR namespace port path ends
|
||||
// |-----------------| |-------------------------| |----------------------------| |---------| |--| |---------------|
|
||||
"((?:[a-z0-9]{2,}:\\/\\/)?(?:(?:[0-9]{1,3}\\.){3}[0-9]{1,3}|(?:[-\\w_\\.]{1,}\\.[a-z]{2,}?))(?::[0-9]{1,5})?.*?(?=[!\"\u00A7 \n]|$))",
|
||||
// schema ipv4 OR namespace port path ends
|
||||
// |-----------------| |-------------------------| |-------------------------| |---------| |--| |---------------|
|
||||
"((?:[a-z0-9]{2,}:\\/\\/)?(?:(?:[0-9]{1,3}\\.){3}[0-9]{1,3}|(?:[-\\w_]{1,}\\.[a-z]{2,}?))(?::[0-9]{1,5})?.*?(?=[!\"\u00A7 \n]|$))",
|
||||
Pattern.CASE_INSENSITIVE);
|
||||
|
||||
public static ITextComponent newChatWithLinks(String string){ return newChatWithLinks(string, true); }
|
||||
|
||||
Reference in new issue
Block a user