update code
This commit is contained in:
+1
-2
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user