Fix URL clicking in chat.
This commit is contained in:
@@ -23,6 +23,7 @@ public class Utility {
|
||||
|
||||
private static final List<String> EMPTY_LIST = new ArrayList<>();
|
||||
static final Pattern DEFAULT_URL_PATTERN = Pattern.compile("(?:(https?)://)?([-\\w_.]+\\.\\w{2,})(/\\S*)?");
|
||||
static final Pattern URL_SCHEME_PATTERN = Pattern.compile("^[a-z][a-z0-9+\\-.]*:");
|
||||
|
||||
private static MiniMessage miniMessage = null;
|
||||
|
||||
@@ -307,6 +308,9 @@ public class Utility {
|
||||
String url = matcher.group();
|
||||
String clickUrl = url;
|
||||
String urlFormat = Config.URLFORMAT;
|
||||
// if (!URL_SCHEME_PATTERN.matcher(clickUrl).find()) {
|
||||
// clickUrl = "http://" + clickUrl;
|
||||
// }
|
||||
message = message.replace(url, urlFormat.replaceAll("<url>", url).replaceAll("<clickurl>", clickUrl));
|
||||
}
|
||||
return message;
|
||||
|
||||
Reference in New Issue
Block a user