Skip to content

Commit

Permalink
Fixes unlimited block duration display (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
codeling committed Jul 29, 2013
1 parent 9349c5b commit 497ecb8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bfstop.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ function getRealDurationFromDBDuration($duration)
: $duration;
}

function getDBDuration($duration)
{
return ($duration >= BFStopDBHelper::$UNLIMITED_DURATION)
? 0
: $duration;
}

function getBlockInterval()
{
$blockDuration = (int)$this->params->get('blockDuration',
Expand All @@ -112,7 +119,7 @@ function blockIfTooManyAttempts($logEntry)
$logEntry->logtime) < $maxNumber) {
return;
}
$this->block($logEntry, $interval);
$this->block($logEntry, $this->getDBDuration($interval));
}


Expand Down

0 comments on commit 497ecb8

Please sign in to comment.