mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-02-19 13:52:19 +01:00
Catch all values greater than 10 years to avoid exploits.
This commit is contained in:
parent
eeea16a99a
commit
2b99ed9a2a
@ -187,10 +187,6 @@ public class Util
|
||||
throw new Exception(_("illegalDate"));
|
||||
}
|
||||
Calendar c = new GregorianCalendar();
|
||||
if (years > 10)
|
||||
{
|
||||
years = 10;
|
||||
}
|
||||
if (years > 0)
|
||||
{
|
||||
c.add(Calendar.YEAR, years * (future ? 1 : -1));
|
||||
@ -219,6 +215,12 @@ public class Util
|
||||
{
|
||||
c.add(Calendar.SECOND, seconds * (future ? 1 : -1));
|
||||
}
|
||||
|
||||
Calendar max = new GregorianCalendar();
|
||||
max.add(Calendar.YEAR, 10);
|
||||
if (c.after(max)) {
|
||||
return max.getTimeInMillis();
|
||||
}
|
||||
return c.getTimeInMillis();
|
||||
}
|
||||
// The player can stand inside these materials
|
||||
|
Loading…
Reference in New Issue
Block a user