Jelajahi Sumber

ACTUALLY handle SQL passwords (or other fields) with '#' in them properly.

GJ 11 tahun lalu
induk
melakukan
7c9356955e

+ 2 - 2
src/main/java/com/gmail/nossr50/config/AutoUpdateConfigLoader.java

@@ -63,7 +63,7 @@ public abstract class AutoUpdateConfigLoader extends ConfigLoader {
             output = output.replace("  ", "    ");
             output = output.replace("  ", "    ");
 
 
             // Rip out Bukkit's attempt to save comments at the top of the file
             // Rip out Bukkit's attempt to save comments at the top of the file
-            while (output.indexOf('#') != -1) {
+            while (!output.startsWith("General:")) {
                 output = output.substring(output.indexOf('\n', output.indexOf('#')) + 1);
                 output = output.substring(output.indexOf('\n', output.indexOf('#')) + 1);
             }
             }
 
 
@@ -76,7 +76,7 @@ public abstract class AutoUpdateConfigLoader extends ConfigLoader {
 
 
                 String line;
                 String line;
                 while ((line = reader.readLine()) != null) {
                 while ((line = reader.readLine()) != null) {
-                    if (line.contains("#") && !line.contains("User_Password:")) {
+                    if (line.contains("#")) {
                         temp += line + "\n";
                         temp += line + "\n";
                     }
                     }
                     else if (line.contains(":")) {
                     else if (line.contains(":")) {