File tree Expand file tree Collapse file tree 3 files changed +22
-3
lines changed
main/java/org/togetherjava/tjbot/features/moderation/scam
test/java/org/togetherjava/tjbot/features/moderation/scam Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 4040 "whatsapp",
4141 "crypto",
4242 "^claim",
43- "teen",
43+ "^ teen$ ",
4444 "adobe",
4545 "^hack$",
4646 "hacks",
Original file line number Diff line number Diff line change 55
66import java .net .URI ;
77import java .util .Locale ;
8+ import java .util .function .Predicate ;
9+ import java .util .regex .Pattern ;
810
911/**
1012 * Analyzes a given text token. Populates various metrics regarding the token possibly being
1416 * {@link #analyze(String, AnalyseResults)}.
1517 */
1618final class TokenAnalyse {
19+ // Tokens like: "org.schema.game.common.data.world.Sector.access$200(Sector.java:120)"
20+ private static final Predicate <String > IS_STACKTRACE_TOKEN =
21+ Pattern .compile ("(org|com|de|dev)(\\ .[^.()]+){4,15}\\ ([^.()]+\\ .java:\\ d+\\ )" )
22+ .asMatchPredicate ();
1723 private final ScamBlockerConfig config ;
1824
1925 TokenAnalyse (ScamBlockerConfig config ) {
@@ -27,7 +33,7 @@ final class TokenAnalyse {
2733 * @param results metrics representing how suspicious the token is
2834 */
2935 void analyze (String token , AnalyseResults results ) {
30- if (token .isBlank ()) {
36+ if (token .isBlank () || IS_STACKTRACE_TOKEN . test ( token ) ) {
3137 return ;
3238 }
3339
Original file line number Diff line number Diff line change @@ -546,6 +546,19 @@ public static void main(String[] args){
546546 https://learn.microsoft.com/en-us/powershell/scripting/discover-powershell?view=powershell-7.5
547547 What makes PowerShell unique is that it accepts and returns .NET objects, rather than text.
548548 because of that, but well it says that it returns .NET objects not that the commands are from .NET,
549- but well as i said i use cmd.exe because i do not know .NET nor powershell""" );
549+ but well as i said i use cmd.exe because i do not know .NET nor powershell""" ,
550+ """
551+ Exception in thread "ServerEntityWriterThread"
552+ java.lang.NoSuchMethodError: org.schema.game.common.controller.rails.RailRelation.isLocked()Z
553+ at org.schema.game.common.controller.rails.RailController.getDockedTag(RailController.java:2686)
554+ at org.schema.game.common.controller.rails.RailController.getTag(RailController.java:2652)
555+ at org.schema.game.common.controller.SegmentController.toTagStructure(SegmentController.java:2813)
556+ at org.schema.game.common.data.EntityFileTools.write(EntityFileTools.java:57)
557+ at org.schema.game.server.controller.GameServerController.writeEntity(GameServerController.java:2938)
558+ at org.schema.game.common.data.world.Sector.writeSingle(Sector.java:2570)
559+ at org.schema.game.common.data.world.Sector.writeEntity(Sector.java:2546)
560+ at org.schema.game.common.data.world.Sector.access$200(Sector.java:120)
561+ at org.schema.game.common.data.world.Sector$3.run(Sector.java:2665)
562+ at org.schema.schine.network.server.ServerEntityWriterThread.run(ServerEntityWriterThread.java:74)""" );
550563 }
551564}
You can’t perform that action at this time.
0 commit comments