update code

This commit is contained in:
Lwei
2026-07-23 16:20:45 +08:00
parent fc6e516ca3
commit 9b5ec7b410
4 changed files with 4 additions and 4 deletions
+1 -2
View File
@@ -211,7 +211,7 @@ class Captcha
$this->fontttf = $ttfs[array_rand($ttfs)];
}
$fontttf = $ttfPath . $this->fontttf;
$fontttf = (strpos($this->fontttf, ':/') !== false || strpos($this->fontttf, ':\\') !== false || $this->fontttf[0] === '/') ? $this->fontttf : $ttfPath . $this->fontttf;
// 添加干扰项
foreach ($this->interfere as $type => $method) {
@@ -229,7 +229,6 @@ class Captcha
$x = $this->fontSize * ($index + 1) * ($this->math ? 1 : 1.5);
$y = $this->fontSize + mt_rand(10, 20);
$angle = $this->math ? 0 : mt_rand(-40, 40);
imagettftext($this->im, (int) $this->fontSize, $angle, (int) $x, (int) $y, $this->color, $fontttf, $char);
}