Skip to content

Commit 497ecb8

Browse files
committed
Fixes unlimited block duration display (#31)
1 parent 9349c5b commit 497ecb8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

bfstop.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ function getRealDurationFromDBDuration($duration)
9595
: $duration;
9696
}
9797

98+
function getDBDuration($duration)
99+
{
100+
return ($duration >= BFStopDBHelper::$UNLIMITED_DURATION)
101+
? 0
102+
: $duration;
103+
}
104+
98105
function getBlockInterval()
99106
{
100107
$blockDuration = (int)$this->params->get('blockDuration',
@@ -112,7 +119,7 @@ function blockIfTooManyAttempts($logEntry)
112119
$logEntry->logtime) < $maxNumber) {
113120
return;
114121
}
115-
$this->block($logEntry, $interval);
122+
$this->block($logEntry, $this->getDBDuration($interval));
116123
}
117124

118125

0 commit comments

Comments
 (0)