Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Commit

Permalink
Fix int overflow on 32-bit systems
Browse files Browse the repository at this point in the history
time() would have been added together twice, causing an overflow, which caused PHP to give back a float, which then caused a crash.

Signed-off-by: Yoshi2889 <[email protected]>
  • Loading branch information
NanoSector committed Aug 3, 2017
1 parent 56eeb7a commit 4002e3c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Moderation.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public function kbanCommand(Channel $source, User $user, $args, ComponentContain
return;
}

$time = time() + 60 * $minutes;
$time = 60 * $minutes;
$this->banUser($source, $userObj, $container, $time, $redirect);

Queue::fromContainer($container)
Expand Down Expand Up @@ -231,7 +231,7 @@ public function banCommand(Channel $source, User $user, $args, ComponentContaine
return;
}

$time = time() + 60 * $minutes;
$time = 60 * $minutes;
$this->banUser($source, $userObj, $container, $time, $redirect);
}

Expand Down Expand Up @@ -297,7 +297,7 @@ protected function banUser(Channel $source, User $userObj, ComponentContainer $c
if ($offset != 0)
{
$args = [$source, $ban, $container];
$task = new CallbackTask([$this, 'removeBan'], (int) $offset, $args);
$task = new CallbackTask([$this, 'removeBan'], $offset, $args);
$this->taskController->add($task);
}

Expand Down

0 comments on commit 4002e3c

Please sign in to comment.