dapphp / securimage

PHP CAPTCHA Script
https://github.com/dapphp/securimage
BSD 2-Clause "Simplified" License
568 stars 190 forks source link

PHP Warning: Division by zero in securimage-3.6.7/securimage.php on line 2112 #88

Closed aisuhua closed 4 years ago

aisuhua commented 5 years ago

If the captcha code contains only one character, such as a, It will cause the error.

$img = new Securimage();
$img->charset = 'a';
$img->code_length = 1;

I run the code in php cli mode, then it show the error:

PHP Warning:  Division by zero in securimage-3.6.7/securimage.php on line 2112

Click to see the line