AntiClear (protection against /clear in bRAC)

This commit is contained in:
pixtaded 2025-02-09 20:15:17 +03:00
parent 72074ca117
commit f03666bead

View File

@ -6,6 +6,8 @@ public class Sanitizer {
if (sanitizeNewlines) { if (sanitizeNewlines) {
sanitized = sanitized.replaceAll("\n", "\\\\n"); sanitized = sanitized.replaceAll("\n", "\\\\n");
if (!s.endsWith("\n")) sanitized += '\n'; if (!s.endsWith("\n")) sanitized += '\n';
} else {
sanitized = sanitized.replaceAll("\n\n+", "\n");
} }
return sanitized; return sanitized;
} }
@ -13,4 +15,4 @@ public class Sanitizer {
public static String formatMessage(long timeMillis, String address, String content) { public static String formatMessage(long timeMillis, String address, String content) {
return String.format("[%td.%1$tm.%1$tY %1$tR] {%s} %s", timeMillis, address, content); return String.format("[%td.%1$tm.%1$tY %1$tR] {%s} %s", timeMillis, address, content);
} }
} }