Skip to content

Commit

Permalink
Update captcha.gif.php
Browse files Browse the repository at this point in the history
  • Loading branch information
rickbot-dot authored Jul 2, 2023
1 parent 90ab9fc commit dad3329
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions captcha.gif.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function generateCaptcha($width = 620, $height = 120, $characters = 14) {
// Write the letters to the image
for ($i = 0; $i < strlen($_SESSION['captcha']); $i++) {
$textColor = imagecolorallocate($image, 100,100,100);
imagettftext($image, 40, rand(-20, 20), ($i * ($width / strlen($_SESSION['captcha']))) + rand(5, 10), rand(($height / 2) - 10, ($height / 2) + 10), $textColor, '$IP/captcha.ttf', $_SESSION['captcha'][$i]);
imagettftext($image, 40, rand(-20, 20), ($i * ($width / strlen($_SESSION['captcha']))) + rand(5, 10), rand(($height / 2) - 10, ($height / 2) + 10), $textColor, "$IP/captcha.ttf", $_SESSION['captcha'][$i]);
}
// Make the image harder to read by bots.
for ($i = 0; $i < 55000; $i++) {
Expand All @@ -42,7 +42,7 @@ public function generateCaptcha($width = 620, $height = 120, $characters = 14) {
imagesetpixel($image, $x, $y, $dot_color);
}
// Put the gif in the browser
header('Content-type: image/gif');
header('Content-type: image/gif');
imagegif($image);
// Nuke the image for security
imagedestroy($image);
Expand Down

0 comments on commit dad3329

Please sign in to comment.