Don't include the database host, user or password in the debug.txt

This commit is contained in:
GeorgH93 2020-08-05 23:27:30 +02:00
parent e8574fcde7
commit 30b52b91ee
No known key found for this signature in database
GPG Key ID: D1630D37F9E4B3C8

View File

@ -87,7 +87,7 @@ public void execute(@NotNull CommandSender commandSender, @NotNull String mainCo
writer.append(plugin.getDescription().getName()).append(" Version: ").append(plugin.getDescription().getVersion());
writer.append("\nServer: ").append(Bukkit.getServer().getBukkitVersion()).append(" (").append(Bukkit.getServer().getVersion()).append(")");
writer.append("\nJava: ").append(System.getProperty("java.version"));
writer.append("\\n\\nPlugins:\n");
writer.append("\n\nPlugins:\n");
for(Plugin p : Bukkit.getServer().getPluginManager().getPlugins())
{
writer.append(p.getName()).append(' ').append(p.getDescription().getVersion()).append('\n');
@ -99,6 +99,7 @@ public void execute(@NotNull CommandSender commandSender, @NotNull String mainCo
while((line = configReader.readLine()) != null)
{
if(line.isEmpty()) continue;
if(line.contains("Host") || line.contains("Password") || line.contains("User")) line = line.replaceAll("^(\\s+\\w+):.*$", "$1: ********");
writer.append(line).append('\n');
}
}