File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
src/main/java/net/javadiscord/javabot/systems/moderation Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -203,13 +203,15 @@ public boolean hasSuspiciousLink(@NotNull Message message) {
203
203
// only do it for a links, so it won't iterate for each message
204
204
while (urlMatcher .find ()) {
205
205
String url = urlMatcher .group (0 ).trim ();
206
- try {
207
- URI uri = new URI (url );
208
- if (uri .getHost () != null && spamUrls .contains (uri .getHost ())) {
209
- return true ;
206
+ if (url .startsWith ("http://" ) || url .startsWith ("https://" )) {
207
+ try {
208
+ URI uri = new URI (url );
209
+ if (uri .getHost () != null && spamUrls .contains (uri .getHost ())) {
210
+ return true ;
211
+ }
212
+ } catch (URISyntaxException e ) {
213
+ ExceptionLogger .capture (e , getClass ().getSimpleName ());
210
214
}
211
- } catch (URISyntaxException e ) {
212
- ExceptionLogger .capture (e , getClass ().getSimpleName ());
213
215
}
214
216
}
215
217
}
You can’t perform that action at this time.
0 commit comments