diff --git a/chat.php b/chat.php index 88495d7..ec8c93f 100644 --- a/chat.php +++ b/chat.php @@ -677,29 +677,34 @@ function send_captcha(): void } else { echo _('Type the characters in the image:'); } - if($difficulty===1){ - $im=imagecreatetruecolor(55, 24); - $bg=imagecolorallocate($im, 0, 0, 0); - $fg=imagecolorallocate($im, 255, 255, 255); + if($difficulty===1 || $difficulty===2){ + $fontwidth = imagefontwidth(5); + $fontheight = imagefontheight(5); + $CAPTCHAWIDTH = $fontwidth * 5 * 3; + $CAPTCHAHEIGHT = $fontheight * 3; + $im=imagecreatetruecolor($CAPTCHAWIDTH, $CAPTCHAHEIGHT); + $bg=imagecolorallocate($im, mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255)); imagefill($im, 0, 0, $bg); - imagestring($im, 5, 5, 5, $code, $fg); - echo ''._('Moderate (deprecated)').''; + echo '>'._('Moderate').''; echo '