Skip to content

Commit

Permalink
Fix #88 - Division by zero if captcha length is 1
Browse files Browse the repository at this point in the history
  • Loading branch information
dapphp committed May 30, 2020
1 parent c8d3c7d commit 633c520
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion securimage.php
Original file line number Diff line number Diff line change
Expand Up @@ -2118,7 +2118,7 @@ protected function drawWord()
$angleN = -$angleN;
}

$step = abs($angle0 - $angleN) / ($this->strlen($captcha_text) - 1);
$step = abs($angle0 - $angleN) / (max(1, $this->strlen($captcha_text) - 1));
$step = ($angle0 > $angleN) ? -$step : $step;
$angle = $angle0;

Expand Down

0 comments on commit 633c520

Please sign in to comment.