You've already forked Arcturus-Morningstar-Extended
mirror of
https://github.com/duckietm/Arcturus-Morningstar-Extended.git
synced 2026-06-19 15:06:19 +00:00
fix(furnidata): correct revert audit enum, sanitize audit values, config-driven maxBytes
This commit is contained in:
@@ -71,7 +71,7 @@ public class FurnitureTextProvider {
|
||||
|
||||
/** Returns the byte cap used when reading furnidata files. */
|
||||
public long getMaxBytes() {
|
||||
return DEFAULT_MAX_BYTES;
|
||||
return Long.parseLong(com.eu.habbo.Emulator.getConfig().getValue("items.furnidata.max.bytes", String.valueOf(DEFAULT_MAX_BYTES)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -155,7 +155,7 @@ public class FurnitureTextProvider {
|
||||
* furni names (controlled, predominantly ASCII source). Lone/astral surrogates are not
|
||||
* specially handled.
|
||||
*/
|
||||
static String sanitize(String value) {
|
||||
public static String sanitize(String value) {
|
||||
if (value == null) return "";
|
||||
StringBuilder sb = new StringBuilder(Math.min(value.length(), MAX_LEN));
|
||||
for (int i = 0; i < value.length() && sb.length() < MAX_LEN; i++) {
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ public class FurniEditorRevertFurnidataEvent extends MessageHandler {
|
||||
FurnidataAuditLog.record(
|
||||
adminId,
|
||||
classnameForLog,
|
||||
"REVERT_FURNIDATA",
|
||||
"revert",
|
||||
"", // previous state unknown at this point
|
||||
"",
|
||||
"",
|
||||
|
||||
+3
-3
@@ -143,11 +143,11 @@ public class FurniEditorUpdateFurnidataEvent extends MessageHandler {
|
||||
FurnidataAuditLog.record(
|
||||
adminId,
|
||||
classname,
|
||||
"UPDATE_FURNIDATA",
|
||||
"edit",
|
||||
oldName != null ? oldName : "",
|
||||
safeName,
|
||||
FurnitureTextProvider.sanitize(safeName),
|
||||
oldDesc,
|
||||
safeDesc
|
||||
FurnitureTextProvider.sanitize(safeDesc)
|
||||
);
|
||||
|
||||
// 7. Respond success
|
||||
|
||||
Reference in New Issue
Block a user