mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI.git
synced 2024-12-25 02:17:43 +01:00
Merge pull request #978 from JulianVennen/block-unverified-expansions
Add environment variable to override cloud_allowunverified_expansions
This commit is contained in:
commit
5623a00f9b
@ -48,6 +48,15 @@ public final class CommandECloudDownload extends PlaceholderCommand {
|
||||
.anyMatch(s -> s.equalsIgnoreCase(name));
|
||||
}
|
||||
|
||||
private boolean areUnverifiedExpansionsAllowed(@NotNull final PlaceholderAPIPlugin plugin) {
|
||||
String env = System.getenv("PAPI_ALLOW_UNVERIFIED_EXPANSIONS");
|
||||
if (env != null) {
|
||||
return env.equalsIgnoreCase("true");
|
||||
}
|
||||
|
||||
return plugin.getPlaceholderAPIConfig().cloudAllowUnverifiedExpansions();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void evaluate(@NotNull final PlaceholderAPIPlugin plugin,
|
||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||
@ -72,7 +81,7 @@ public final class CommandECloudDownload extends PlaceholderCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!expansion.isVerified() && !plugin.getPlaceholderAPIConfig().cloudAllowUnverifiedExpansions()) {
|
||||
if (!expansion.isVerified() && !this.areUnverifiedExpansionsAllowed(plugin)) {
|
||||
Msg.msg(sender, "&cThe expansion '&f" + params.get(0) + "&c' is not verified and can only be downloaded manually from &fhttps://placeholderapi.com/ecloud");
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user