Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1 from samilturgut/master
Browse files Browse the repository at this point in the history
Fixed PHP Deprecated:  Implicit conversion from float, CaptchaBuilder…
  • Loading branch information
aliozkan authored Dec 21, 2022
2 parents d30031a + 19c03d6 commit 6924a4e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Gregwar/Captcha/CaptchaBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,12 @@ protected function writePhrase($image, $phrase, $font, $width, $height)
}

// Gets the text size and start position
$size = $width / $length - $this->rand(0, 3) - 1;
$size = (int) round($width / $length) - $this->rand(0, 3) - 1;
$box = \imagettfbbox($size, 0, $font, $phrase);
$textWidth = $box[2] - $box[0];
$textHeight = $box[1] - $box[7];
$x = ($width - $textWidth) / 2;
$y = ($height - $textHeight) / 2 + $size;
$x = (int) round(($width - $textWidth) / 2);
$y = (int) round(($height - $textHeight) / 2) + $size;

if (!$this->textColor) {
$textColor = array($this->rand(0, 150), $this->rand(0, 150), $this->rand(0, 150));
Expand Down

0 comments on commit 6924a4e

Please sign in to comment.