Skip to content

Commit

Permalink
Merge pull request #77 from OpticFusion1/update
Browse files Browse the repository at this point in the history
Now takes into account plugin names/authors with spaces
  • Loading branch information
OpticFusion1 authored Apr 20, 2019
2 parents b7dbd5e + 25cbd60 commit 001020f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>optic_fusion1</groupId>
<artifactId>MCAntiMalware</artifactId>
<version>3.35</version>
<version>3.36</version>
<packaging>jar</packaging>
<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import optic_fusion1.mcantimalware.configuration.file.YamlConfiguration;
import optic_fusion1.mcantimalware.logging.CustomLogger;
import org.apache.commons.codec.digest.DigestUtils;

public class CheckManager {

private List<Check> checks = new ArrayList<>();
Expand Down Expand Up @@ -67,13 +68,13 @@ public boolean isInChecksumDatabase(File file) {
try {
inputStream = jarFile.getInputStream(jarEntry);
} catch (Exception ex) {
if(main.shouldLogDebugMessages()){
if (main.shouldLogDebugMessages()) {
jarFile.close();
logger.exception(ex);
return false;
}
}
if(inputStream == null){
if (inputStream == null) {
return false;
}
FileConfiguration config = YamlConfiguration.loadConfiguration(inputStream);
Expand All @@ -89,16 +90,16 @@ public boolean isInChecksumDatabase(File file) {
String author = "";
String name = "";
if (config.isSet("author")) {
author = config.getString("author").replaceAll(" ", "-");
if (main.shouldLogDebugMessages()) {
logger.debug("Author: " + config.getString("author"));
logger.debug("Author: " + author);
}
author = config.getString("author");
}
if (config.isSet("name")) {
name = config.getString("name").replaceAll(" ", "-");
if (main.shouldLogDebugMessages()) {
logger.debug("Plugin Name: " + config.getString("name"));
logger.debug("Plugin Name: " + name);
}
name = config.getString("name");
}
if (name.isEmpty()) {
return false;
Expand Down

0 comments on commit 001020f

Please sign in to comment.