From e7990a06e24495524fe99ad1195e9303d592f6d7 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Mon, 30 Jan 2017 19:42:16 +1100 Subject: [PATCH] Check player name for invalid character first --- .../com/intellectualcrafters/plot/util/StringMan.java | 9 +++++++++ .../plot/util/UUIDHandlerImplementation.java | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Core/src/main/java/com/intellectualcrafters/plot/util/StringMan.java b/Core/src/main/java/com/intellectualcrafters/plot/util/StringMan.java index 7a0d857ae..aba375ec8 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/util/StringMan.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/util/StringMan.java @@ -279,4 +279,13 @@ public class StringMan { } return col; } + + public static boolean contains(String name, char c) { + for (char current : name.toCharArray()) { + if (c == current) { + return true; + } + } + return false; + } } diff --git a/Core/src/main/java/com/intellectualcrafters/plot/util/UUIDHandlerImplementation.java b/Core/src/main/java/com/intellectualcrafters/plot/util/UUIDHandlerImplementation.java index c62d003a4..69b33a59f 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/util/UUIDHandlerImplementation.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/util/UUIDHandlerImplementation.java @@ -232,7 +232,7 @@ public abstract class UUIDHandlerImplementation { return uuid; } // Read from disk OR convert directly to offline UUID - if (Settings.UUID.OFFLINE) { + if (Settings.UUID.OFFLINE && !StringMan.contains(name, ';')) { uuid = this.uuidWrapper.getUUID(name); add(new StringWrapper(name), uuid); return uuid;