Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/main/java/ch/njol/skript/expressions/ExprHash.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@ public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelaye
String algorithm = parseResult.tags.get(0).toUpperCase(Locale.ENGLISH);
try {
digest = MessageDigest.getInstance(algorithm);
if (algorithm.equals("MD5") && !getParser().getCurrentScript().suppressesWarning(ScriptWarning.DEPRECATED_SYNTAX)) {
Skript.warning("MD5 is not secure and shouldn't be used if a cryptographically secure hashing algorithm is required.");
if (algorithm.equals("MD5")) {
try {
if (!getParser().getCurrentScript().suppressesWarning(ScriptWarning.DEPRECATED_SYNTAX))
Skript.warning("MD5 is not secure and shouldn't be used if a cryptographically secure hashing algorithm is required.");
} catch (Exception e) {}
}
return true;
} catch (NoSuchAlgorithmException e) {
Expand Down