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) {
203203 // only do it for a links, so it won't iterate for each message
204204 while (urlMatcher .find ()) {
205205 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 ());
210214 }
211- } catch (URISyntaxException e ) {
212- ExceptionLogger .capture (e , getClass ().getSimpleName ());
213215 }
214216 }
215217 }
You can’t perform that action at this time.
0 commit comments