From fa59f9f6cd869b81c1b95da0e0a894113318aa46 Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Sat, 27 Jul 2013 09:44:08 +0200 Subject: [PATCH] Check the file ending. Fixes #11. --- src/com/massivecraft/mcore/util/MUtil.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/com/massivecraft/mcore/util/MUtil.java b/src/com/massivecraft/mcore/util/MUtil.java index 29694351..bbdc6d0c 100644 --- a/src/com/massivecraft/mcore/util/MUtil.java +++ b/src/com/massivecraft/mcore/util/MUtil.java @@ -102,7 +102,12 @@ public class MUtil for (File playerfile : playerfiles) { String filename = playerfile.getName(); + + // Ensure it's actually a .dat player filefile + if (!filename.toLowerCase().endsWith(".dat")) continue; + String playername = filename.substring(0, filename.length()-4); + ret.add(playername); }