EffectCommand: restrict range of values for duration, fixes #2055

This commit is contained in:
Dylan K. Taylor 2018-03-30 11:51:20 +01:00
parent 773f760fff
commit d53258c943

View File

@ -80,7 +80,10 @@ class EffectCommand extends VanillaCommand{
$amplification = 0;
if(count($args) >= 3){
$duration = ((int) $args[2]) * 20; //ticks
if(($d = $this->getBoundedInt($sender, $args[2], 0, INT32_MAX)) === null){
return false;
}
$duration = $d * 20; //ticks
}else{
$duration = null;
}